comparison Messaging/Server/UI/MainWindow.xaml @ 26:045dac571339

Working on data binding to a user control
author adminsh@apollo
date Wed, 21 Mar 2012 15:39:53 +0000
parents
children 96fdf58e05b4
comparison
equal deleted inserted replaced
25:81f9b72a44ce 26:045dac571339
1 <metro:Window x:Class="Server.UI.MainWindow"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:c="clr-namespace:Common.Controls;assembly=Common"
5 xmlns:converters="clr-namespace:Server.Converters"
6 xmlns:metro="http://schemas.codeplex.com/elysium/theme"
7 Title="Messaging Server"
8 Width="700"
9 Height="475"
10 MinWidth="700"
11 MinHeight="475"
12 DataContext="{Binding MainWindowViewModel,
13 Source={StaticResource Locator}}"
14 Icon="{StaticResource Mail}">
15
16 <TabControl Margin="{Binding Source={x:Static metro:Parameters.Instance}, Path=BoldPadding, Mode=OneWay}">
17 <TabItem Header="dashboard">
18 <Grid HorizontalAlignment="Center">
19 <Grid.ColumnDefinitions>
20 <ColumnDefinition Width="220" />
21 <ColumnDefinition Width="220" />
22 <ColumnDefinition Width="220" />
23 </Grid.ColumnDefinitions>
24 <Grid.RowDefinitions>
25 <RowDefinition Height="Auto" />
26 <RowDefinition Height="220" />
27 <RowDefinition Height="*" />
28 <RowDefinition Height="50" />
29 </Grid.RowDefinitions>
30
31 <ToggleButton Grid.Row="0"
32 Grid.Column="0"
33 Margin="10,10,10,0"
34 Content="{Binding SocketEndPoint.IsListening,
35 Converter={converters:ToggleButtonToTextConverter}}"
36 IsChecked="{Binding SocketEndPoint.IsListening}"
37 IsEnabled="True"
38 IsThreeState="False" />
39
40 <ToggleButton Grid.Row="0"
41 Grid.Column="1"
42 Margin="10,10,10,0"
43 Content="{Binding SocketEndPoint.IsListening,
44 Converter={converters:ToggleButtonToTextConverter}}"
45 IsChecked="{Binding SocketEndPoint.IsListening}"
46 IsEnabled="True" />
47
48 <ToggleButton Grid.Row="0"
49 Grid.Column="2"
50 Margin="10,10,10,0"
51 Content="{Binding SocketEndPoint.IsListening,
52 Converter={converters:ToggleButtonToTextConverter}}"
53 IsChecked="{Binding SocketEndPoint.IsListening}"
54 IsEnabled="True" />
55
56 <c:MessageTile Grid.Row="1"
57 Grid.Column="0"
58 Background="{StaticResource MetroPurpleBrush}"
59 DisplayCount="{Binding SocketEndPoint.DisplayCount, Mode= TwoWay, UpdateSourceTrigger=PropertyChanged}"
60 DisplayIcon="{StaticResource Mail}"
61 DisplayText="{Binding SocketEndPoint.DisplayText}"
62 Foreground="White"
63 ToolTip="{Binding SocketEndPoint.ToolTip}" />
64
65 <c:MessageTile Grid.Row="1"
66 Grid.Column="1"
67 Background="{StaticResource MetroGreenBrush}"
68 DisplayCount="{Binding SocketEndPoint.DisplayCount}"
69 DisplayIcon="{StaticResource Mail}"
70 DisplayText="{Binding DisplayText}"
71 Foreground="White"
72 ToolTip="{Binding SocketEndPoint.ToolTip}" />
73
74 <c:MessageTile Grid.Row="1"
75 Grid.Column="2"
76 Background="{StaticResource MetroOrangeBrush}"
77 DisplayCount="{Binding SocketEndPoint.DisplayCount}"
78 DisplayIcon="{StaticResource Mail}"
79 DisplayText="{Binding SocketEndPoint.DisplayText}"
80 Foreground="White"
81 ToolTip="{Binding SocketEndPoint.ToolTip}" />
82
83 <TextBlock Grid.Row="2"
84 Grid.Column="0"
85 Margin="10"
86 Background="{StaticResource MetroGrayBrush}"
87 Padding="10"
88 Text="{Binding SocketEndPoint.DisplayLog}"
89 TextWrapping="Wrap" />
90
91 <TextBlock Grid.Row="2"
92 Grid.Column="1"
93 Margin="10"
94 Background="{StaticResource MetroGrayBrush}"
95 Padding="10"
96 Text="{Binding SocketEndPoint.DisplayLog}"
97 TextWrapping="WrapWithOverflow" />
98
99 <TextBlock Grid.Row="2"
100 Grid.Column="2"
101 Margin="10"
102 Background="{StaticResource MetroGrayBrush}"
103 Padding="10"
104 Text="{Binding SocketEndPoint.DisplayLog}"
105 TextWrapping="WrapWithOverflow" />
106
107 <metro:ToggleSwitch Grid.Row="3"
108 Grid.Column="0"
109 Width="80"
110 Height="50"
111 Margin="10"
112 HorizontalAlignment="Left"
113 IsChecked="{Binding OverrideSwitch}"
114 IsEnabled="True" />
115 <Button Grid.Row="3"
116 Grid.Column="2"
117 Width="75"
118 Margin="10"
119 HorizontalAlignment="Right"
120 Command="{Binding CloseCommand}"
121 Content="Close" />
122 </Grid>
123 </TabItem>
124 </TabControl>
125 </metro:Window>