MainWindow.xaml
5.8 KB
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
<!--
/***********************************************
* CONFIDENTIAL AND PROPRIETARY
*
* The source code and other information contained herein is the confidential and exclusive property of
* ZIH Corp. and is subject to the terms and conditions in your end user license agreement.
* This source code, and any other information contained herein, shall not be copied, reproduced, published,
* displayed or distributed, in whole or in part, in any medium, by any means, for any purpose except as
* expressly permitted under such license agreement.
*
* Copyright ZIH Corp. 2018
*
* ALL RIGHTS RESERVED
***********************************************/
-->
<Window x:Class="Zebra.Windows.DevDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Zebra.Windows.DevDemo"
xmlns:utils="clr-namespace:Zebra.Windows.DevDemo.Utils"
xmlns:connectivity="clr-namespace:Zebra.Windows.DevDemo.Demos.Connectivity"
xmlns:discovery="clr-namespace:Zebra.Windows.DevDemo.Demos.Discovery"
xmlns:imageprint="clr-namespace:Zebra.Windows.DevDemo.Demos.ImagePrint"
xmlns:listformats="clr-namespace:Zebra.Windows.DevDemo.Demos.ListFormats"
xmlns:magcard="clr-namespace:Zebra.Windows.DevDemo.Demos.MagCard"
xmlns:printerstatus="clr-namespace:Zebra.Windows.DevDemo.Demos.PrinterStatus"
xmlns:profile="clr-namespace:Zebra.Windows.DevDemo.Demos.Profile"
xmlns:sendfile="clr-namespace:Zebra.Windows.DevDemo.Demos.SendFile"
xmlns:settings="clr-namespace:Zebra.Windows.DevDemo.Demos.Settings"
xmlns:smartcard="clr-namespace:Zebra.Windows.DevDemo.Demos.SmartCard"
xmlns:storedformat="clr-namespace:Zebra.Windows.DevDemo.Demos.StoredFormat"
xmlns:connectionbuilder="clr-namespace:Zebra.Windows.DevDemo.Demos.ConnectionBuilder"
mc:Ignorable="d"
WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True"
Title="Zebra Developer Demos" MinWidth="640" Width="640" MinHeight="480" Height="480">
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>
<Window.Resources>
<utils:DemoViewModelNameValueConverter x:Key="converter" />
<DataTemplate DataType="{x:Type connectivity:ConnectivityViewModel}">
<connectivity:ConnectivityView />
</DataTemplate>
<DataTemplate DataType="{x:Type discovery:DiscoveryViewModel}">
<discovery:DiscoveryView />
</DataTemplate>
<DataTemplate DataType="{x:Type imageprint:ImagePrintViewModel}">
<imageprint:ImagePrintView />
</DataTemplate>
<DataTemplate DataType="{x:Type listformats:ListFormatsViewModel}">
<listformats:ListFormatsView />
</DataTemplate>
<DataTemplate DataType="{x:Type magcard:MagCardViewModel}">
<magcard:MagCardView />
</DataTemplate>
<DataTemplate DataType="{x:Type printerstatus:PrinterStatusViewModel}">
<printerstatus:PrinterStatusView />
</DataTemplate>
<DataTemplate DataType="{x:Type profile:ProfileViewModel}">
<profile:ProfileView />
</DataTemplate>
<DataTemplate DataType="{x:Type sendfile:SendFileViewModel}">
<sendfile:SendFileView />
</DataTemplate>
<DataTemplate DataType="{x:Type settings:SettingsViewModel}">
<settings:SettingsView />
</DataTemplate>
<DataTemplate DataType="{x:Type smartcard:SmartCardViewModel}">
<smartcard:SmartCardView />
</DataTemplate>
<DataTemplate DataType="{x:Type storedformat:StoredFormatViewModel}">
<storedformat:StoredFormatView />
</DataTemplate>
<DataTemplate DataType="{x:Type connectionbuilder:ConnectionBuilderViewModel}">
<connectionbuilder:ConnectionBuilderView />
</DataTemplate>
<BitmapImage x:Key="ZebraLogoImageSource" UriSource="../../../Resources/Images/Zebra_Logo_W.png" />
</Window.Resources>
<DockPanel>
<Grid x:Name="titleBar" DockPanel.Dock="Top" Background="#007CB0" MouseDown="TitleBar_MouseDown">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="{StaticResource ZebraLogoImageSource}" Width="120" Height="40" Margin="15" />
<TextBlock x:Name="closeButton" Grid.Column="1" Foreground="White" FontWeight="Bold" FontSize="24" Padding="10,0" VerticalAlignment="Top" HorizontalAlignment="Right" PreviewMouseLeftButtonDown="CloseButton_PreviewMouseLeftButtonDown">×</TextBlock>
</Grid>
<DockPanel DockPanel.Dock="Left" Margin="10" Width="150">
<TextBlock Style="{StaticResource ZebraHeader}" DockPanel.Dock="Top" Margin="0,0,0,10">Available Demos</TextBlock>
<ListBox ItemsSource="{Binding DemoViewModels}">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding Converter={StaticResource converter}}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
<ContentControl Content="{Binding CurrentDemoViewModel}" />
</DockPanel>
</Window>