| Home | Course Index | << Prev. | Next >> | PDF Version of this Page |
![]() |
Course API Comparison
|
For an introduction into Microsofts XAML see: XAML.
For an introduction into Microsofts XAML Browser Application-API see: XBAP.
Guidance for Visual C# 2010 Express Edition:
1) Main Menu after start of VS 2010: Tools → Options → check lower left checkbox: Show all Settings → Projects and Solutions → Visual Studio projects location: → C:\temp.
2) Main Menu after start of VS 2010: File → New Project... → Visual Studio installed templates: WPF Browser Application
Name: compareWPF_Browser → OK.
Replace the default code of Page1.xaml by the following lines:
<Page x:Class="compareWPF_Browser.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPF Browser Application in XAML + C#">
<Viewbox>
<Border BorderBrush="Black" BorderThickness="2">
<StackPanel Orientation="Horizontal" Margin="2">
<Button Content="Talk!" Click="button1Click" HorizontalAlignment="Left"/>
<TextBox x:Name="textBox" Margin="2,0,2,0" MinWidth="300" TextAlignment="Center"/>
<Button Content="Clear" Click="button2Click" HorizontalAlignment="Right"/>
</StackPanel>
</Border>
</Viewbox>
</Page>
Replace the default code of Page1.xaml.cs by the following lines:
using System;
using System.Windows.Controls;
namespace compareWPF_Browser
{ public partial class Page1:Page
{ public Page1()
{ InitializeComponent();
}
private void button1Click( Object sender, EventArgs e )
{ textBox.Text = "WPF Browser Application in XAML + C#. Resize!";
}
private void button2Click( Object sender, EventArgs e )
{ textBox.Text = "";
}
}
}
Click Debug → Start Without Debugging Ctrl F5.
Click the Talk!-button and resize the browser.
Your C:\temp\compareWPF_Browser\bin\Release-directory will contain a compareWPF_Browser.xbap-file, which can be executed by the Internet Explorer and by Mozilla Firefox.
| top of page: |