1 <UserControl xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" x:Class="WEBSWAPP.SilverLightUI.Page"

    2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    4    Loaded="UserControl_Loaded" Height="540" >

    5     <Canvas x:Name="LayoutRoot" >

    6         <basics:TabControl HorizontalAlignment="Left" Width="1000" Height="510" BorderBrush="Gainsboro" BorderThickness="1">

    7             <basics:TabItem Header="Display Location Information" Width="200">

    8                 <Grid Width="1000" Height="500" VerticalAlignment="top" HorizontalAlignment="Left" >

    9                     <Grid.RowDefinitions>

   10                         <RowDefinition Height="30"/>

   11                         <RowDefinition Height="*"/>

   12                     </Grid.RowDefinitions>

   13                     <Grid.ColumnDefinitions>

   14                         <ColumnDefinition Width="470"/>

   15                         <ColumnDefinition Width="*"/>

   16                     </Grid.ColumnDefinitions>

   17                     <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="2" Background="#7298b4"  >

   18                         <TextBlock Text="Display the cities where country name=" TextAlignment="Left" Padding="3" Foreground="White"

   19                    VerticalAlignment="Bottom" />

   20                         <ComboBox Name="cbCountries" Height="25" Width="150" DisplayMemberPath="Name"

   21                   SelectionChanged="cbCountries_SelectionChanged"    />

   22                         <TextBlock Text="AND (" VerticalAlignment="Bottom"  Padding="3" Foreground="White" />

   23                         <TextBlock Text="city name starts with"  VerticalAlignment="Bottom"  Padding="3" Foreground="White" />

   24                         <TextBox Name="tbCity" TextChanged="tbCity_TextChanged" Width="100" Height="20"

   25                  HorizontalAlignment="Left"  />

   26                         <TextBlock Text="  OR  " VerticalAlignment="Bottom"  Padding="3" Foreground="White" />

   27                         <TextBlock Text="the city is a capital city"  VerticalAlignment="Bottom"  Padding="3" Foreground="White" />

   28                         <CheckBox Name="chkCapital" VerticalAlignment="Bottom" Margin ="3" Click="CheckBox_Click" ></CheckBox>

   29                         <TextBlock Text=")" VerticalAlignment="Bottom"  Padding="3" Foreground="White" />

   30                     </StackPanel>

   31                     <ListBox Name="lbLocations" Height="430" Width="460" Grid.Column="0" Grid.Row="1"  

   32                 HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="0" SelectionChanged="ListBox_SelectionChanged" >

   33                         <ListBox.ItemTemplate >

   34                             <DataTemplate>

   35 

   36                                 <StackPanel Orientation="Horizontal" >

   37                                     <TextBlock Text="{Binding Name}" Height="20" Width="170"/>

   38                                     <TextBlock Text="{Binding Province}" Height="20" Width="170"/>

   39                                     <TextBlock Text="{Binding Country}" Height="20" Width="100"/>

   40                                 </StackPanel>

   41                             </DataTemplate>

   42                         </ListBox.ItemTemplate>

   43                     </ListBox>

   44 

   45                     <StackPanel Grid.Column="1" Grid.Row ="1" Orientation="Vertical">

   46                         <TextBlock Name="tbCityName" Text="City Information" Width="400" Height="30" VerticalAlignment="Bottom" />

   47                         <ListBox Name="lbCityInfo" Width="450" Height="auto">

   48                             <ListBox.ItemTemplate>

   49                                 <DataTemplate>

   50                                     <StackPanel Orientation="Horizontal">

   51                                         <TextBlock Text="{Binding PropertyName}" Height="20" Width="200" TextAlignment="Right" />

   52                                         <TextBlock Text="{Binding PropertyValue}" Height="20" Width="150" TextAlignment="Right" />

   53                                         <TextBlock Text="{Binding Measure}" Height="20" Width="70" Padding="10,0,0,0"/>

   54                                     </StackPanel>

   55                                 </DataTemplate>

   56                             </ListBox.ItemTemplate>

   57 

   58                         </ListBox>

   59 

   60                         <TextBlock Name="tbProvinceName" Text="Province Information" Width="400" Height="30" VerticalAlignment="Bottom" />

   61                         <ListBox Name="lbProvinceInfo" Width="450" Height="auto">

   62                             <ListBox.ItemTemplate>

   63                                 <DataTemplate>

   64                                     <StackPanel Orientation="Horizontal">

   65                                         <TextBlock Text="{Binding PropertyName}" Height="20" Width="200" TextAlignment="Right" />

   66                                         <TextBlock Text="{Binding PropertyValue}" Height="20" Width="150" TextAlignment="Right" />

   67                                         <TextBlock Text="{Binding Measure}" Height="20" Width="70" Padding="10,0,0,0"/>

   68                                     </StackPanel>

   69                                 </DataTemplate>

   70                             </ListBox.ItemTemplate>

   71                         </ListBox>

   72 

   73                         <TextBlock Name="tbCountryName" Text="Country Information" Width="400" Height="30" VerticalAlignment="Bottom" />

   74                         <ListBox Name="lbCountryInfo" Width="450" Height="auto">

   75                             <ListBox.ItemTemplate>

   76                                 <DataTemplate>

   77                                     <StackPanel Orientation="Horizontal">

   78                                         <TextBlock Text="{Binding PropertyName}" Height="20" Width="200" TextAlignment="Right" />

   79                                         <TextBlock Text="{Binding PropertyValue}" Height="20" Width="150" TextAlignment="Right" />

   80                                         <TextBlock Text="{Binding Measure}" Height="20" Width="70" Padding="10,0,0,0"/>

   81                                     </StackPanel>

   82                                 </DataTemplate>

   83                             </ListBox.ItemTemplate>

   84                         </ListBox>

   85                         <TextBox Name ="tbStatus" Width="350" Height="auto" TextWrapping="Wrap" Visibility="Collapsed" />

   86                     </StackPanel>

   87                 </Grid>

   88 

   89             </basics:TabItem>

   90             <basics:TabItem Header="Login" Width="100">

   91                 <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="This demo is still under development.  Please check again in a few days"></TextBlock>

   92             </basics:TabItem>

   93             <basics:TabItem Header="Profile" Width="100">

   94 

   95             </basics:TabItem>

   96             <basics:TabItem Header="Edit Cities Information" Width="200">

   97 

   98             </basics:TabItem>

   99         </basics:TabControl>

  100 

  101     </Canvas>

  102 

  103 </UserControl>