<Window Text="Xul Challenge 2004"> <FlowPanel> <SimpleText>Counter Sample</SimpleText> <TextBox ID="ValueTextBox" HorizontalAlignment="Center" IsReadOnly="True"/> <FlowPanel HorizontalAlignment="Center" Width="100%"> <Button Click="Dec">Dec (-)</Button> <Button Click="Clear">Clear</Button> <Button Click="Inc">Inc (+)</Button> </FlowPanel> </FlowPanel></Window>
1. XAML-Example<TextPanel Background="BlanchedAlmond" FontFamily="Comic sans MS" FontSize="36pt" HorizontalAlignment="Center"> Hello, world!</TextPanel>2. C#-Exampleusing System;using System.Windows;using System.Windows.Controls;using System.Windows.Media;class HelloWorldApp : Application{ static void Main() { HelloWorldApp app = new HelloWorldApp(); app.Run(); } protected override void OnStartingUp( StartingUpCancelEventArgs args ) { Window win = new Window(); TextPanel tp = new TextPanel(); tp.Background = Brushes.BlanchedAlmond; tp.FontFamily = "Comic sans MS"; tp.FontSize = new FontSize( 36f, FontSizeType.Point); tp.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; tp.TextRange.Text = "Hello, world"; win.Children.Add(tp); win.Show(); }}