添加项目文件。
This commit is contained in:
164
CapMachine.Wpf/Views/MainView.xaml
Normal file
164
CapMachine.Wpf/Views/MainView.xaml
Normal file
@@ -0,0 +1,164 @@
|
||||
<Window
|
||||
x:Class="CapMachine.Wpf.Views.MainView"
|
||||
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:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:CapMachine.Wpf.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
Title="压缩机耐久测试平台"
|
||||
Width="1920"
|
||||
Height="1080"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<md:ColorZone md:ElevationAssist.Elevation="Dp2" Mode="PrimaryDark">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Margin="15" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0,15,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="22"
|
||||
FontWeight="Bold"
|
||||
Text="压缩机耐久测试软件平台" />
|
||||
</StackPanel>
|
||||
|
||||
<ListBox
|
||||
x:Name="listBox"
|
||||
Grid.Column="1"
|
||||
ItemsSource="{Binding MenuService.MenuItems}"
|
||||
SelectedIndex="{Binding SelectedIndex}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Grid>
|
||||
<Border x:Name="border" />
|
||||
<Border x:Name="borderheader" Background="{TemplateBinding Background}" />
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}" />
|
||||
</Grid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter TargetName="borderheader" Property="Background" Value="#ffffff" />
|
||||
<Setter TargetName="borderheader" Property="Opacity" Value="0.1" />
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#ffffff" />
|
||||
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,3" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="borderheader" Property="Background" Value="#ffffff" />
|
||||
<Setter TargetName="borderheader" Property="Opacity" Value="0.1" />
|
||||
<Setter TargetName="border" Property="BorderBrush" Value="#ffffff" />
|
||||
<Setter TargetName="border" Property="BorderThickness" Value="0,0,0,3" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Margin="20,5"
|
||||
FontSize="16"
|
||||
Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<i:InvokeCommandAction Command="{Binding NavigateCommand}" CommandParameter="{Binding ElementName=listBox, Path=SelectedItem}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</md:ColorZone>
|
||||
|
||||
<md:DialogHost Grid.Row="1">
|
||||
<!-- Content="{Binding ElementName=MainViewContentControl, Path=Content, Mode=TwoWay}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}" -->
|
||||
<md:DrawerHost Content="{Binding ElementName=MainViewContentControl, Path=Content, Mode=TwoWay}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}">
|
||||
<md:DrawerHost.TopDrawerContent>
|
||||
<ItemsControl Padding="0,5,0,20" ItemsSource="{Binding MenuService.MenuItems[0].Items}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Margin="15,10" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
|
||||
<ItemsControl
|
||||
Grid.Row="1"
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Top"
|
||||
ItemsSource="{Binding Items}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid VerticalAlignment="Center" Columns="2" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Height="40" Margin="5">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="10,5" Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</md:DrawerHost.TopDrawerContent>
|
||||
</md:DrawerHost>
|
||||
</md:DialogHost>
|
||||
|
||||
<ContentControl
|
||||
x:Name="MainViewContentControl"
|
||||
prism:RegionManager.RegionName="MainViewContentRegion"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user