PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/V4/Quickstarts/View-Switching Navigation/Silverlight/View-Switching Navigation/ViewSwitchingNavigation.Contacts/Views/ContactDetailView.xaml

#
XAML | 52 lines | 45 code | 7 blank | 0 comment | 0 complexity | 93f70b81a6e6c9dfe9027582c30e2f62 MD5 | raw file
 1<UserControl x:Class="ViewSwitchingNavigation.Contacts.Views.ContactDetailView"
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 4    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 5    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 6    mc:Ignorable="d"
 7    d:DesignHeight="300" d:DesignWidth="400" 
 8    d:DataContext="{d:DesignData /SampleData/ContactSampleData.xaml}">
 9
10    <UserControl.Resources>
11        <DataTemplate x:Key="ContactDetailTemplate">
12            <Grid>
13                <Grid.ColumnDefinitions>
14                    <ColumnDefinition Width="Auto"/>
15                    <ColumnDefinition Width="*"/>
16                </Grid.ColumnDefinitions>
17
18                <Grid.RowDefinitions>
19                    <RowDefinition Height="Auto"/>
20                    <RowDefinition Height="Auto"/>
21                    <RowDefinition Height="Auto"/>
22                    <RowDefinition Height="Auto"/>
23                    <RowDefinition Height="Auto"/>
24                    <RowDefinition Height="Auto"/>
25                    <RowDefinition Height="Auto"/>
26                </Grid.RowDefinitions>
27
28                <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14"
29                           Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"/>
30
31                <TextBlock Text="Company" Foreground="#FF525252"
32                           Grid.Row="1" Grid.Column="0" Margin="0,0,15,0"/>
33                <TextBlock Text="{Binding Company}"
34                           Grid.Row="1" Grid.Column="1"/>
35
36                <TextBlock Text="E-mail" Foreground="#FF525252"
37                           Grid.Row="2" Grid.Column="0" Margin="0,0,15,0"/>
38                <TextBlock Text="{Binding EmailAddress}"
39                           Grid.Row="2" Grid.Column="1"/>
40
41                <TextBlock Text="Address" Foreground="#FF525252"
42                           Grid.Row="3" Grid.Column="0" Margin="0,0,15,0"/>
43                <TextBlock Text="{Binding Address}"
44                           Grid.Row="3" Grid.Column="1"/>
45
46            </Grid>
47        </DataTemplate>
48    </UserControl.Resources>
49    <Grid x:Name="LayoutRoot">
50        <ContentControl Content="{Binding}" ContentTemplate="{StaticResource ContactDetailTemplate}"/>
51    </Grid>
52</UserControl>