-
Notifications
You must be signed in to change notification settings - Fork 15
/
MainPage.xaml
172 lines (162 loc) · 14.5 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
<Page
x:Class="ScreenlyManager.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="using:ScreenlyManager"
xmlns:converter="using:ScreenlyManager.Converters"
mc:Ignorable="d">
<Page.Resources>
<converter:StatusConverter x:Key="ColorConverter"/>
<converter:MimeTypeConverter x:Key="MimetypeConverter"/>
</Page.Resources>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<SplitView IsPaneOpen="True" DisplayMode="Inline" OpenPaneLength="296">
<SplitView.Pane>
<Grid>
<!-- Left list -->
<TextBlock x:Uid="MainPageDeviceTitle" Grid.Column="0" Text="" FontSize="15" VerticalAlignment="Top" Margin="12,14"/>
<ProgressRing Grid.Column="0" x:Name="ProgressRingLoadingDevice" Height="24" Width="24" VerticalAlignment="Top" Canvas.ZIndex="1" IsActive="False" Margin="12,14" HorizontalAlignment="Right" />
<CommandBar x:Name="CommandBarLeft" Grid.Column="0" VerticalAlignment="Bottom" Canvas.ZIndex="1">
<AppBarButton x:Uid="MainPageDeviceAdd" x:Name="AppBarButtonAddDevice" Icon="Add" Label="" Click="AppBarButtonAddDevice_Click"/>
<AppBarButton x:Uid="MainPageDeviceRefresh" x:Name="AppBarButtonRefreshDevice" Icon="Refresh" Label="" Click="AppBarButtonRefreshDevice_Click"/>
<AppBarButton x:Uid="MainPageExportConf" x:Name="AppBarButtonExportConf" Icon="SaveLocal" Label="" Click="AppBarButtonExportConf_Click"/>
<AppBarButton x:Uid="MainPageImportConf" x:Name="AppBarButtonImportConf" Icon="Upload" Label="" Click="AppBarButtonImportConf_Click"/>
</CommandBar>
<ListView x:Name="ListViewDevice" Grid.Column="0" Margin="10,50,10,10" ItemClick="ListViewDeviceItem_Click" IsItemClickEnabled="True" IsMultiSelectCheckBoxEnabled="False" RightTapped="ListViewDevice_RightTapped">
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:Device">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="48"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2" Grid.Column="0" Source="Assets/raspberry-36.png" HorizontalAlignment="Left" VerticalAlignment="Center" Stretch="None"/>
<TextBlock Text="{x:Bind Name}" Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" FontSize="20"/>
<TextBlock Text="{x:Bind Location}" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" FontSize="11" />
<TextBlock Text="{x:Bind IpAddress}" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" FontSize="11" HorizontalAlignment="Right"/>
<Ellipse Grid.Column="3" Grid.Row="0" Fill="{x:Bind IsUp, Converter={StaticResource ColorConverter}}" HorizontalAlignment="Right" VerticalAlignment="Top" Height="12" Width="12"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="5,10"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.Resources>
<MenuFlyout x:Name="MenuFlyoutDevice">
<MenuFlyout.Items>
<MenuFlyoutItem x:Uid="MainPageMenuFlyoutEdit" x:Name="MenuFlyoutItemEditDevice" Text="Edit" Click="MenuFlyoutItemEditDevice_Click" />
<MenuFlyoutItem x:Uid="MainPageMenuFlyoutRemove" x:Name="MenuFlyoutItemRemoveDevice" Text="Remove" Click="MenuFlyoutItemRemoveDevice_Click" />
<MenuFlyoutItem x:Uid="MainPageMenuFlyoutOpen" x:Name="MenuFlyoutItemOpenDevice" Text="Open on browser" Click="MenuFlyoutItemOpenDevice_Click" />
</MenuFlyout.Items>
</MenuFlyout>
</ListView.Resources>
</ListView>
</Grid>
</SplitView.Pane>
<Grid>
<!-- Main Page -->
<CommandBar x:Name="CommandBarMain" Grid.Column="1">
<CommandBar.Content>
<TextBlock x:Uid="MainPageAssetTitle" x:Name="TextBlockCommandBarMain" Text="" Margin="12,14"/>
</CommandBar.Content>
<AppBarButton x:Uid="MainPageAssetAdd" x:Name="AppBarButtonAddAsset" Icon="Add" Label="" Click="AppBarButtonAddAsset_Click" IsEnabled="False"/>
<AppBarButton x:Uid="MainPageAssetRefresh" x:Name="AppBarButtonRefreshAssets" Icon="Refresh" Label="" Click="AppBarButtonRefreshAssets_Click"/>
</CommandBar>
<ScrollViewer Grid.Column="1" Margin="10,50,10,10" VerticalScrollBarVisibility="Auto">
<StackPanel>
<Border Background="#FFBC1142">
<TextBlock x:Uid="MainPageAssetActive" x:Name="TextBlockActiveAsset" Text="" Padding="10,15" Foreground="#FFFFFF" FontSize="20"/>
</Border>
<!-- Active Assets -->
<ListView x:Name="ListViewActiveAssets" Margin="10,10,10,10" CanReorderItems="True" AllowDrop="True" CanDragItems="True" SelectionMode="Extended" DragItemsCompleted="ListViewActiveAssets_DragItemsCompleted">
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:Asset">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="36" />
<ColumnDefinition Width="36" />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="108" />
</Grid.ColumnDefinitions>
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{x:Bind Mimetype, Converter={StaticResource MimetypeConverter}}" FontFamily="Segoe MDL2 Assets" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{x:Bind Name}" Grid.Column="2" FontSize="18" VerticalAlignment="Center" Padding="0,0,5,0"/>
<TextBlock Text="{x:Bind StartDate}" Grid.Column="3" FontSize="16" VerticalAlignment="Center" Padding="0,0,5,0"/>
<TextBlock Text="{x:Bind EndDate}" Grid.Column="4" FontSize="16" VerticalAlignment="Center" Padding="0,0,5,0"/>
<Button x:Name="ButtonPreview" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonPreview_Click" Tag="{x:Bind ReadableUri}"/>
<Button x:Name="ButtonEdit" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="6" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonEdit_Click" Tag="{x:Bind AssetId}"/>
<Button x:Name="ButtonRemove" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonRemove_Click" Tag="{x:Bind AssetId}"/>
<Button x:Name="ButtonDuplicate" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="8" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonDuplicate_Click" Tag="{x:Bind AssetId}"/>
<ToggleSwitch Grid.Column="9" x:Name="ToggleSwitchEnable" IsOn="{x:Bind IsEnabledSwitch}" OnContent="On" OffContent="Off" Toggled="ToggleSwitchEnable_Toggled" Padding="5,0" Tag="{x:Bind AssetId}"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="5,10"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
<Border Background="#FFBC1142">
<TextBlock x:Uid="MainPageAssetInactive" x:Name="TextBlockInactiveAsset" Text="" Padding="10,15" Foreground="#FFFFFF" FontSize="20"/>
</Border>
<!-- Inactive Assets -->
<ListView x:Name="ListViewInactiveAssets" Margin="10,10,10,10" IsMultiSelectCheckBoxEnabled="False">
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:Asset">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="36" />
<ColumnDefinition Width="36" />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="108" />
</Grid.ColumnDefinitions>
<TextBlock Text="{x:Bind Mimetype, Converter={StaticResource MimetypeConverter}}" FontFamily="Segoe MDL2 Assets" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="{x:Bind Name}" Grid.Column="2" FontSize="18" VerticalAlignment="Center" Padding="0,0,5,0"/>
<TextBlock Text="{x:Bind StartDate}" Grid.Column="3" FontSize="16" VerticalAlignment="Center" Padding="0,0,5,0"/>
<TextBlock Text="{x:Bind EndDate}" Grid.Column="4" FontSize="16" VerticalAlignment="Center" Padding="0,0,5,0"/>
<Button x:Name="ButtonPreview" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonPreview_Click" Tag="{x:Bind ReadableUri}"/>
<Button x:Name="ButtonChange" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="6" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonEdit_Click" Tag="{x:Bind AssetId}"/>
<Button x:Name="ButtonRemove" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="7" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonRemove_Click" Tag="{x:Bind AssetId}"/>
<Button x:Name="ButtonDuplicate" Content="" FontFamily="Segoe MDL2 Assets" Grid.Column="8" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="5,0" FontSize="20" Height="36" Click="ButtonDuplicate_Click" Tag="{x:Bind AssetId}"/>
<ToggleSwitch Grid.Column="9" x:Name="ToggleSwitchEnable" IsOn="{x:Bind IsEnabledSwitch}" OnContent="On" OffContent="Off" Padding="5,0" Toggled="ToggleSwitchEnable_Toggled" Tag="{x:Bind AssetId}"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="5,10"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</StackPanel>
</ScrollViewer>
</Grid>
</SplitView>
</Grid>
</Page>