|
- <Window
- x:Class="ModbusDemo.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:ModbusDemo"
- xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:viewmodel="clr-namespace:ModbusDemo.VIewModel"
- d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel,IsDesignTimeCreatable=True}"
- Title="MainWindow"
- Width="900"
- Height="600"
- WindowStartupLocation="CenterScreen"
- mc:Ignorable="d">
- <WindowChrome.WindowChrome>
- <WindowChrome GlassFrameThickness="-1"></WindowChrome>
- </WindowChrome.WindowChrome>
- <md:DialogHost DialogTheme="Inherit" Identifier="RootDialog">
-
- <md:DrawerHost x:Name="drawerHost" IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
- <!-- 菜单 -->
- <md:DrawerHost.LeftDrawerContent>
- <DockPanel MinWidth="220">
- <StackPanel Margin="0,20" DockPanel.Dock="Top">
-
- </StackPanel>
- <!-- 菜单列表 -->
- <ListBox x:Name="lbMenu" ItemsSource="{Binding LeftMenusList}" ItemContainerStyle="{StaticResource LeftMenuStyle}" SelectionChanged="lbMenu_SelectionChanged">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding NavigationCmm}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}">
- </i:InvokeCommandAction>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" Background="Transparent" >
- <md:PackIcon Margin="15,0" HorizontalAlignment="Center" VerticalAlignment="Center" Kind="{Binding Icon}" FontSize="20">
- </md:PackIcon>
- <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MenuName}" FontSize="20">
- </TextBlock>
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </DockPanel>
- </md:DrawerHost.LeftDrawerContent>
- <!-- 头部 -->
- <DockPanel>
- <md:ColorZone
- Padding="16"
- md:ElevationAssist.Elevation="Dp4"
- MouseDoubleClick="ColorZone_MouseDoubleClick"
- DockPanel.Dock="Top"
- Mode="PrimaryMid">
- <DockPanel LastChildFill="True">
- <StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
-
- <Button x:Name="btnMin" Content="—" Style="{StaticResource MaterialDesignFlatMidBgButton}" Click="btnMin_Click" />
- <Button x:Name="btnMax" Content="☐" Style="{StaticResource MaterialDesignFlatMidBgButton}" Click="btnMax_Click" />
- <Button x:Name="btnClose" Content="✕" Style="{StaticResource MaterialDesignFlatMidBgButton}" Click="btnClose_Click" />
- </StackPanel>
-
- <StackPanel Orientation="Horizontal">
- <ToggleButton x:Name="MenuToggleButton" AutomationProperties.Name="HamburgerToggleButton" IsChecked="False" Style="{StaticResource MaterialDesignHamburgerToggleButton}" />
-
-
-
- <TextBlock
- Margin="15,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- AutomationProperties.Name="Mat15.0erial Design In XAML Toolkit"
- FontSize="22"
- Text="ModBus" />
- </StackPanel>
- </DockPanel>
- </md:ColorZone>
-
- <!-- 区域 -->
- <ContentControl prism:RegionManager.RegionName="ModbusRegion">
- </ContentControl>
- </DockPanel>
- </md:DrawerHost>
- </md:DialogHost>
- </Window>
|