-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
366 lines (316 loc) · 23.3 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<phone:PhoneApplicationPage
x:Class="LiveSynergyUIDesign.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:LiveSynergy="clr-namespace:LiveSynergyUIDesign"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!-- a good color: Dodger Blue -->
<phone:PhoneApplicationPage.Resources>
<!-- The template for the list header. This will scroll as a part of the list. -->
<!-- <DataTemplate x:Key="DeviceListHeader">
<TextBlock Text="public devices" Style="{StaticResource PhoneTextTitle1Style}"/>
</DataTemplate> -->
<!-- The group header template, for groups in the main list -->
<DataTemplate x:Key="DeviceGroupHeaderLocation">
<Border Background="{StaticResource PhoneAccentBrush}" Padding="{StaticResource PhoneTouchTargetOverhang}">
<TextBlock Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
</Border>
</DataTemplate>
<DataTemplate x:Key="DeviceGroupHeaderNameFirst">
<Border Background="Transparent">
<Border Background="{StaticResource PhoneAccentBrush}" Width="75" Height="75" HorizontalAlignment="Left">
<TextBlock Text="{Binding Key}"
Foreground="{StaticResource PhoneForegroundBrush}"
Style="{StaticResource PhoneTextExtraLargeStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</Border>
</Border>
</DataTemplate>
<!-- The template for groups when they are items in the "jump list". Not setting -->
<!-- the GroupItemTemplate property will disable "jump list" functionality. -->
<DataTemplate x:Key="groupItemHeaderLocation">
<Border Background="{StaticResource PhoneAccentBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" Padding="{StaticResource PhoneTouchTargetOverhang}">
<TextBlock Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
</Border>
</DataTemplate>
<DataTemplate x:Key="groupItemHeaderNameFirst">
<Border Background="{StaticResource PhoneAccentBrush}" Width="99" Height="99" Margin="6" IsHitTestVisible="{Binding HasItems}">
<TextBlock Text="{Binding Key}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"
FontSize="36"
Margin="{StaticResource PhoneTouchTargetOverhang}"
Foreground="{StaticResource PhoneForegroundBrush}"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</Border>
</DataTemplate>
<DataTemplate x:Key="groupItemHeaderName">
<Border Background="{StaticResource PhoneAccentBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" Padding="{StaticResource PhoneTouchTargetOverhang}">
<TextBlock Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
</Border>
</DataTemplate>
<!-- The template for Device items -->
<DataTemplate x:Key="DeviceItemTemplate">
<Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
<StackPanel VerticalAlignment="Top">
<TextBlock Text="{Binding DeviceName}" Style="{StaticResource PhoneTextLargeStyle}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" TextWrapping="Wrap" Margin="12,0,12,6"/>
<!-- <TextBlock Text="{Binding DeviceLocation}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/> -->
</StackPanel>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu>
<toolkit:MenuItem Header="View" Click="OnMenuClicked" Tag="VIEW" />
<toolkit:MenuItem Header="Remove" Click="OnMenuClicked" Tag="REMOVE" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</Grid>
</DataTemplate>
<LiveSynergy:DeviceByLocation x:Key="DeviceByLocation"/>
</phone:PhoneApplicationPage.Resources>
<controls:Panorama Name="panorama"
Title="LiveSynergy">
<controls:Panorama.Background>
Transparent
<!-- <ImageBrush ImageSource="/Component/samplePhoto.jpg"/> -->
</controls:Panorama.Background>
<controls:PanoramaItem Header="indoor map">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x:Name="PageTitle" Text="To-do" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
</Grid>
</controls:PanoramaItem>
<!-- The second page, revealing all devices-->
<controls:PanoramaItem Header="devices">
<controls:PanoramaItem.Resources>
<Style x:Key="MetroUIText"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"></Setter>
<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"></Setter>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Style>
<LinearGradientBrush x:Key="MetroBackground">
<GradientStop Offset="0" Color="DodgerBlue"/>
<GradientStop Offset="1" Color="DodgerBlue"/>
</LinearGradientBrush>
<Style x:Key="MetroUIBorder"
TargetType="Border">
<Setter Property="Background" Value="{StaticResource MetroBackground}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Width" Value="200"/>
<Setter Property="Height" Value="200"/>
<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="Margin" Value="0,0,20,10"/>
<Setter Property="CornerRadius" Value="1" />
</Style>
</controls:PanoramaItem.Resources>
<toolkit:LongListSelector x:Name="ListPublicThing" Background="Transparent"
GroupHeaderTemplate="{StaticResource DeviceGroupHeaderNameFirst}"
GroupItemTemplate="{StaticResource groupItemHeaderNameFirst}"
ItemTemplate="{StaticResource DeviceItemTemplate}">
<!-- temporarily commented
ListHeaderTemplate="{StaticResource DeviceListHeader}"
GroupHeaderTemplate="{StaticResource DeviceGroupHeader}"
GroupItemTemplate="{StaticResource groupItemHeader}"
ItemTemplate="{StaticResource DeviceItemTemplate}"> -->
</toolkit:LongListSelector>
<!--ContentPanel - place additional content here-->
<!-- <Grid x:Name="ObjectContentPanel" Grid.Row="1" Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ListBox Grid.Column="0"
Name="PrivateThingList"
HorizontalAlignment="Center"
SelectionChanged="OnListBoxSelectionChanged">
<ListBox.ItemTemplate> -->
<!-- Objects of type Physical Device -->
<!-- <DataTemplate>
<Grid Background="Transparent">
<Border Style="{StaticResource MetroUIBorder}">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu DataContext="{Binding}">
<toolkit:MenuItem Header="View" Click="OnMenuClicked" Tag="VIEW" />
<toolkit:MenuItem Header="Remove" Click="OnMenuClicked" Tag="REMOVE" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
<TextBlock Text="{Binding ObjectName}" Style="{StaticResource MetroUIText}"/>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid> -->
</controls:PanoramaItem>
<controls:PanoramaItem Header="program" Margin="0, 0">
<!--ContentPanel - place additional content here-->
<Grid x:Name="ProgrammingContentPanel" Grid.Row="2" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- <Grid Grid.Row="0" Margin="0,0,0,10">
<Rectangle x:Name="rect" Width="150" Height="60"
StrokeThickness="1"
Stroke="Magenta"
Margin="30 0"
HorizontalAlignment="Left">
</Rectangle>
<Rectangle Width="100" Height="70"
StrokeThickness="1"
Stroke="Magenta"
Margin="30 0"
HorizontalAlignment="Right">
<Rectangle.RenderTransform>
<TransformGroup>
<SkewTransform AngleX="45" AngleY="0" CenterX="0" CenterY="0"/>
<RotateTransform Angle="-22.5" CenterX="0" CenterY="0"/>
<TranslateTransform X="-60" Y="35"/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
</Grid> -->
<TextBlock Grid.Row="0" x:Name="Description" TextWrapping="Wrap">
Wanna take control of your devices? Create something like the flowchart below. It's easy and straightforward. Click it and start your own.
<Run Foreground="Red" Text=" Currently only support this scheme!"/>
</TextBlock>
<Canvas x:Name="MainCanvas" Margin="0,20,0,0" Grid.Row="1" Height="240" VerticalAlignment="Top">
<!-- <toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="OnTapFlowChart"/>
</toolkit:GestureService.GestureListener> -->
<Canvas x:Name="EventDiamond" Width="240" Height="88" VerticalAlignment="Bottom" d:LayoutOverrides="Width" Canvas.Left="80">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="OnTapEvent"/>
</toolkit:GestureService.GestureListener>
<Rectangle Fill="#FFF4F4F5" Height="70.7" Canvas.Left="70.006" Stroke="Red" StrokeThickness="3" Canvas.Top="4.312" Width="100" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
<Rectangle.RenderTransform>
<CompositeTransform SkewX="45" Rotation="-22.5"/>
</Rectangle.RenderTransform>
</Rectangle>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="53.1" Canvas.Left="-1.507" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="36.598" UseLayoutRounding="False" Width="3.001"/>
<Path Data="M320,99.25 L320,171.25" Fill="#FFFFFF00" Height="52.838" Canvas.Left="238.513" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="36.662" UseLayoutRounding="False" Width="3"/>
<Path Data="M46.5,97.916656 L16,97.833344" Fill="#FFFFFF00" Height="3.001" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="38.106" UseLayoutRounding="False" Width="35.583" Canvas.Left="-1.615"/>
<Path Data="M296,96 L320,96" Fill="#FFFFFF00" Height="3.001" Canvas.Left="205.542" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="38.167" UseLayoutRounding="False" Width="35.938"/>
<TextBlock x:Name="Event" Canvas.Left="80" TextWrapping="Wrap" Canvas.Top="16" Height="43" Width="80" Foreground="#FFF70F0F" FontSize="16"><Run FontStyle="Italic" Text="Something"/><LineBreak/><Run FontStyle="Italic" Text=" Happens?"/></TextBlock>
<TextBlock TextWrapping="Wrap" Text="Yes" Canvas.Top="12" Foreground="#FFF52B2B"/>
<TextBlock Canvas.Left="213" TextWrapping="Wrap" Text="No" Canvas.Top="11" Foreground="#FFF52B2B"/>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="-6.56" Canvas.Top="74.579">
<Path.RenderTransform>
<CompositeTransform Rotation="-45"/>
</Path.RenderTransform>
</Path>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="3.487" Canvas.Top="74.551">
<Path.RenderTransform>
<CompositeTransform Rotation="45"/>
</Path.RenderTransform>
</Path>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="243.541" Canvas.Top="74.306">
<Path.RenderTransform>
<CompositeTransform Rotation="45"/>
</Path.RenderTransform>
</Path>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="233.468" Canvas.Top="74.355">
<Path.RenderTransform>
<CompositeTransform Rotation="-45"/>
</Path.RenderTransform>
</Path>
</Canvas>
<Canvas x:Name="CommandRectangle1" Height="102" Width="128" Canvas.Left="16" Canvas.Top="88">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="OnTapCommand1"/>
</toolkit:GestureService.GestureListener>
<Rectangle Fill="#FFF4F4F5" Height="56" Stroke="Red" Width="128"/>
<TextBlock x:Name="Command1" TextWrapping="Wrap" Height="48" Width="128" Foreground="#FFF70F0F"><Run FontStyle="Italic" Text="a device"/><LineBreak/><Run FontStyle="Italic" Text="do something"/></TextBlock>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="49.531" Canvas.Left="62.498" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="54" UseLayoutRounding="False" Width="3.001"/>
<Path Data="M163.54881,106.90105 L163.73222,190.89259" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="57.438" Canvas.Top="88.359">
<Path.RenderTransform>
<CompositeTransform Rotation="-45" TranslateX="-1.4063839337552508E-07" TranslateY="9.5845687830831139E-08"/>
</Path.RenderTransform>
</Path>
<Path Data="M-128.27692,106.52034 L-128.09351,190.51189" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="67.541" Canvas.Top="88.363">
<Path.RenderTransform>
<CompositeTransform Rotation="45" TranslateX="1.4257289215890978E-07" TranslateY="-2.1429102936565414E-08"/>
</Path.RenderTransform>
</Path>
</Canvas>
<Canvas x:Name="CommandRectangle2" Height="102" Width="128" Canvas.Left="256" Canvas.Top="88">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Tap="OnTapCommand2"/>
</toolkit:GestureService.GestureListener>
<Rectangle Fill="#FFF4F4F5" Height="56" Stroke="Red" Width="128"/>
<TextBlock x:Name="Command2" TextWrapping="Wrap" Height="48" Width="128" Foreground="#FFF70F0F"><Run FontStyle="Italic" Text="a device"/><LineBreak/><Run FontStyle="Italic" Text="do something"/></TextBlock>
<Path Data="M17.635965,98.715851 L17.819376,182.7074" Fill="#FFFFFF00" Height="49.531" Canvas.Left="62.498" Stretch="Fill" Stroke="Red" StrokeThickness="3" Canvas.Top="54" UseLayoutRounding="False" Width="3.001"/>
<Path Data="M163.54881,106.90105 L163.73222,190.89259" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="57.438" Canvas.Top="88.359">
<Path.RenderTransform>
<CompositeTransform Rotation="-45" TranslateX="-1.4063839337552508E-07" TranslateY="9.5845687830831139E-08"/>
</Path.RenderTransform>
</Path>
<Path Data="M-128.27692,106.52034 L-128.09351,190.51189" Fill="#FFFFFF00" Height="16" Stretch="Fill" Stroke="Red" StrokeThickness="3" UseLayoutRounding="False" Width="3.001" RenderTransformOrigin="0.5,0.5" Canvas.Left="67.541" Canvas.Top="88.363">
<Path.RenderTransform>
<CompositeTransform Rotation="45" TranslateX="1.4257289215890978E-07" TranslateY="-2.1429102936565414E-08"/>
</Path.RenderTransform>
</Path>
</Canvas>
<Canvas x:Name="EndCanvas2" Width="82" Height="80" Canvas.Left="63" Canvas.Top="189">
<Ellipse Fill="#FFF4F4F5" Height="35" Stroke="Red" Width="35"/>
<TextBlock TextWrapping="Wrap" Text="end" Foreground="#FFF50606" Height="33" Width="35" Canvas.Top="2"/>
</Canvas>
<Canvas x:Name="EndCanvas2_Copy" Width="82" Height="80" Canvas.Left="303" Canvas.Top="189">
<Ellipse Fill="#FFF4F4F5" Height="35" Stroke="Red" Width="35"/>
<TextBlock TextWrapping="Wrap" Text="end" Foreground="#FFF50606" Height="33" Width="35" Canvas.Top="2"/>
</Canvas>
</Canvas>
</Grid>
</controls:PanoramaItem>
</controls:Panorama>
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar StateChanged="Appbar_StateChanged" Opacity="0">
<shell:ApplicationBarIconButton x:Name="appbarAddButton"
IconUri="/Images/appbar.add.rest.png"
Text="Add"
Click="OnAppbarAddClick"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="Sign Up"
Click="OnClickSignUp">
</shell:ApplicationBarMenuItem>
<shell:ApplicationBarMenuItem Text="Program This!"
Click="OnClickProgramThis">
</shell:ApplicationBarMenuItem>
<shell:ApplicationBarMenuItem Text="sort by name"
Click="OnClickSortByName">
</shell:ApplicationBarMenuItem>
<shell:ApplicationBarMenuItem Text="sort by location"
Click="OnClickSortByLocation">
</shell:ApplicationBarMenuItem>
<shell:ApplicationBarMenuItem Text="View Previous Program"
Click="OnClickViewProgram">
</shell:ApplicationBarMenuItem>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>