forked from lt8300877/NormalizingApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
146 lines (135 loc) · 9.39 KB
/
MainWindow.xaml
File metadata and controls
146 lines (135 loc) · 9.39 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
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
<Window
x:Class="NormalizingApp.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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
mc:Ignorable="d"
Height="800" Width="1280"
WindowStyle="None" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Closing">
<i:InvokeCommandAction Command="{Binding WindowClosing}" />
</i:EventTrigger>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding WindowLoaded}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.CheckBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ListView.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RadioButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToggleButton.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignCaptionTextBlock}" x:Key="Caption">
<Setter Property="Opacity" Value="0.68"></Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<materialDesign:DialogHost x:Name="DialogHostWait">
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
<materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel MinWidth="212">
<Grid DockPanel.Dock="Top" Background="{DynamicResource PrimaryHueMidBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="25">系统菜单</TextBlock>
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}"
Grid.Column="1"
HorizontalAlignment="Right" Margin="16"
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
</Grid>
<ListView x:Name="DemoItemsListView" ItemsSource="{Binding DemoItems}" Margin="0 16 0 16" SelectedIndex="0" FontSize="20"
PreviewMouseLeftButtonUp="UIElement_OnPreviewMouseLeftButtonUp" >
<ListView.View>
<GridView>
<GridViewColumn Header="界面选择">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel Margin="8" Orientation="Horizontal">
<materialDesign:PackIcon Kind="Airplay" HorizontalAlignment="Center" VerticalAlignment="Center" Height="32" Width="32" Margin="0,0,8,0"/>
<TextBlock Text="{Binding Path= Name}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</DockPanel>
</materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel>
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2"
Mode="PrimaryMid" DockPanel.Dock="Top">
<DockPanel>
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="False" x:Name="MenuToggleButton"/>
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<StackPanel>
<Button Content="重启计算机" Click="MenuPopupButton_OnClick" />
<Button Content="关闭计算机" Click="MenuPopupButton_OnClick" />
<Separator/>
<Button Content="退出系统" Click="MenuPopupButton_OnClick"/>
</StackPanel>
</materialDesign:PopupBox>
<TextBlock TextAlignment="Center" FontSize="30">全自动钢轨焊接接头热处理设备</TextBlock>
</DockPanel>
</materialDesign:ColorZone>
<Grid DockPanel.Dock="Bottom">
<Grid Margin="2" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="当前界面: " />
<TextBlock Text="{Binding ElementName=DemoItemsListView,Path=SelectedItem.Name}" />
<TextBlock Margin="20,0,0,0">版本号:</TextBlock>
<TextBlock Text="{Binding Path=VersionNumber}"/>
<TextBlock Margin="20,0,0,0">通讯状态:</TextBlock>
<TextBlock Text="{Binding Path=ConnectionState}"/>
<TextBlock Margin="20,0,0,0" Foreground="DodgerBlue">焊缝编号:</TextBlock>
<TextBlock Foreground="DodgerBlue" Text="{Binding Path=ProductNumber}"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" >
<TextBlock>时间:</TextBlock>
<TextBlock Text="{Binding Path=SystempDateTime}"/>
<TextBlock Margin="20,0,0,0">通讯延迟:</TextBlock>
<TextBlock Text="{Binding Path=ConnectionDelay}"/>
<TextBlock>ms</TextBlock>
</StackPanel>
</Grid>
</Grid>
</Grid>
<Grid>
<ContentControl x:Name="UserContentControl" Content="{Binding ElementName=DemoItemsListView, Path=SelectedItem.Content}"/>
<materialDesign:Snackbar MessageQueue="{materialDesign:MessageQueue}" x:Name="SoftSnackbar"/>
</Grid>
</DockPanel>
</materialDesign:DrawerHost>
<materialDesign:DialogHost.DialogContent>
<StackPanel Margin="16">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="10" IsIndeterminate="True" Value="0" />
<TextBlock x:Name="TextBlock_DialogMessageConent" FontSize="15"/>
</StackPanel>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
</Window>