添加项目文件。
This commit is contained in:
317
SamplePreSystemApp/AppMainView.xaml
Normal file
317
SamplePreSystemApp/AppMainView.xaml
Normal file
@@ -0,0 +1,317 @@
|
||||
<Window
|
||||
x:Class="SamplePreSystemApp.AppMainView"
|
||||
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:local="clr-namespace:SamplePreSystemApp"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
|
||||
Title="自动化样品前处理平台"
|
||||
Width="1200"
|
||||
Height="850"
|
||||
AllowsTransparency="True"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||
FontWeight="ExtraLight"
|
||||
Loaded="Window_Loaded"
|
||||
TextElement.FontSize="13"
|
||||
TextElement.FontWeight="Regular"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
TextOptions.TextFormattingMode="Ideal"
|
||||
TextOptions.TextRenderingMode="Auto"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowStyle="None"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Window.Resources>
|
||||
<sys:Double x:Key="LefBarFontSize">15</sys:Double>
|
||||
|
||||
<Style
|
||||
x:Key="CloseButtonCircleStyle"
|
||||
BasedOn="{StaticResource MaterialDesignFlatMidBgButton}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Width" Value="32" />
|
||||
<Setter Property="Height" Value="32" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="DarkRed" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome
|
||||
CaptionHeight="0"
|
||||
GlassFrameThickness="0"
|
||||
ResizeBorderThickness="6"
|
||||
UseAeroCaptionButtons="False" />
|
||||
</WindowChrome.WindowChrome>
|
||||
|
||||
<Border Background="White" CornerRadius="12">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="20"
|
||||
Opacity="0.2"
|
||||
ShadowDepth="0" />
|
||||
</Border.Effect>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="25" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 顶部标题栏 -->
|
||||
<materialDesign:ColorZone
|
||||
Grid.Row="0"
|
||||
Padding="5"
|
||||
Mode="PrimaryMid"
|
||||
MouseMove="ColorZone_MouseMove">
|
||||
<Grid>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<Border Background="White" CornerRadius="20">
|
||||
<TextBlock
|
||||
Margin="2"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="6"
|
||||
FontWeight="Bold"
|
||||
Foreground="#0170cc"
|
||||
Text="RONCHON" />
|
||||
</Border>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Microsoft YaHei"
|
||||
FontSize="18"
|
||||
FontWeight="ExtraLight"
|
||||
Foreground="White"
|
||||
Text="自 动 化 样 品 前 处 理 平 台" />
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnMonitor"
|
||||
Margin="20,0"
|
||||
Click="btnMonitor_Click"
|
||||
Content="{materialDesign:PackIcon Kind=CameraMeteringMatrix,
|
||||
Size=25}"
|
||||
Foreground="White"
|
||||
Style="{StaticResource MaterialDesignToolButton}"
|
||||
ToolTip="样品监控" />
|
||||
|
||||
<StackPanel VerticalAlignment="Center" ToolTip="{Binding UserInfo}">
|
||||
<Border
|
||||
Margin="10,0"
|
||||
BorderBrush="White"
|
||||
BorderThickness="2"
|
||||
CornerRadius="30"
|
||||
ToolTip="{Binding UserInfo}">
|
||||
<Button
|
||||
x:Name="btnUserInfo"
|
||||
Width="23"
|
||||
Height="23"
|
||||
Click="btnUserInfo_Click"
|
||||
Content="{materialDesign:PackIcon Kind=AccountOutline,
|
||||
Size=15}"
|
||||
Foreground="White"
|
||||
Style="{StaticResource MaterialDesignToolButton}"
|
||||
ToolTip="{Binding UserInfo}" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,20,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="White"
|
||||
Text="{Binding UserInfo}" />
|
||||
|
||||
<Button
|
||||
Name="btnMin"
|
||||
Click="btnMin_Click"
|
||||
Content="—"
|
||||
Style="{StaticResource MaterialDesignFlatMidBgButton}" />
|
||||
<Button
|
||||
Name="btnMax"
|
||||
Click="btnMax_Click"
|
||||
Content="🗖"
|
||||
Style="{StaticResource MaterialDesignFlatMidBgButton}" />
|
||||
<Button
|
||||
Name="btnClose"
|
||||
Click="btnClose_Click"
|
||||
Content="🗙"
|
||||
Style="{StaticResource CloseButtonCircleStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</materialDesign:ColorZone>
|
||||
|
||||
<!-- 中间区域:左侧菜单 + 主内容 -->
|
||||
<DockPanel Grid.Row="1" LastChildFill="True">
|
||||
<!-- 左侧菜单:展开占据区域,收缩隐藏 -->
|
||||
<Grid
|
||||
x:Name="MenuContainer"
|
||||
Width="200"
|
||||
Background="#4a5459"
|
||||
DockPanel.Dock="Left">
|
||||
<Grid x:Name="MenuContent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="40,33,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{StaticResource LefBarFontSize}"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="功能列表" />
|
||||
|
||||
<ListBox
|
||||
x:Name="FuncListbox"
|
||||
Grid.Row="1"
|
||||
Margin="0,30"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="ExtraLight"
|
||||
Foreground="White"
|
||||
ItemsSource="{Binding MenuBars}"
|
||||
SelectionChanged="FuncListbox_SelectionChanged">
|
||||
|
||||
<!-- 分组样式(带折叠/展开) -->
|
||||
<ListBox.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="GroupItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="GroupItem">
|
||||
<StackPanel>
|
||||
<!-- 分组标题(可点击折叠) -->
|
||||
<Border
|
||||
Background="Transparent"
|
||||
Cursor="Hand"
|
||||
MouseLeftButtonUp="GroupHeader_MouseLeftButtonUp">
|
||||
<DockPanel LastChildFill="True">
|
||||
<!-- 折叠/展开箭头图标 -->
|
||||
<materialDesign:PackIcon
|
||||
Width="18"
|
||||
Height="18"
|
||||
Margin="10,5"
|
||||
VerticalAlignment="Center"
|
||||
Kind="ChevronDown"
|
||||
Tag="Expanded" />
|
||||
|
||||
<!-- 分组名称 -->
|
||||
<TextBlock
|
||||
Margin="5,5"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{StaticResource LefBarFontSize}"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 分组子项容器(折叠核心) -->
|
||||
<ItemsPresenter x:Name="PART_ItemsPresenter" />
|
||||
</StackPanel>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</ListBox.GroupStyle>
|
||||
|
||||
<!-- 菜单项模板 -->
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel
|
||||
Height="30"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="10,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Kind="{Binding packIconKind}" />
|
||||
<TextBlock
|
||||
Margin="15,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{StaticResource LefBarFontSize}"
|
||||
Text="{Binding name}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- 主内容区域 -->
|
||||
<Grid Background="White">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="107*" />
|
||||
<ColumnDefinition Width="18*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<materialDesign:Snackbar
|
||||
x:Name="snackbar"
|
||||
Margin="356,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
MessageQueue="{materialDesign:MessageQueue}" />
|
||||
<Frame
|
||||
x:Name="MainFrame"
|
||||
Grid.ColumnSpan="2"
|
||||
NavigationUIVisibility="Hidden" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
<!-- 悬浮开关按钮:永远显示 -->
|
||||
<Canvas
|
||||
Grid.Row="1"
|
||||
Margin="5,25,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
|
||||
<ToggleButton
|
||||
x:Name="MenuToggleButton"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Panel.ZIndex="9999"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Checked="MenuToggleButton_Checked"
|
||||
Foreground="White"
|
||||
Style="{StaticResource MaterialDesignHamburgerToggleButton}"
|
||||
Unchecked="MenuToggleButton_Unchecked" />
|
||||
|
||||
|
||||
</Canvas>
|
||||
|
||||
<!-- 底部状态栏 -->
|
||||
<Grid Grid.Row="2" Background="#F0F0F0">
|
||||
<StackPanel Margin="5,0" Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="自动化样品平台:" />
|
||||
<TextBlock VerticalAlignment="Center" Text="启动完成" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="版本号:" />
|
||||
<TextBlock VerticalAlignment="Center" Text="1.0.0" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
Reference in New Issue
Block a user