You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
6.6 KiB

3 years ago
<Window x:Class="ECMonitor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:prism="http://prismlibrary.com/"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:names="clr-namespace:ECMonitor.Page.Name"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
x:Name="mainWindow"
Title="视频监控" Height="800" Width="1080" Icon="/resources/Images/zgx.ico" WindowStyle="None" WindowStartupLocation="CenterScreen" WindowState="Maximized">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=mainWindow}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<materialDesign:DialogHost Identifier="RootDialog"
DialogTheme="Inherit" SnackbarMessageQueue="{Binding ElementName=MainSnackbar, Path=MessageQueue}">
<Grid Background="{DynamicResource PrimaryBodyBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="58*" />
<RowDefinition Height="1000*" />
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" MouseMove="DockPanel_MouseMove">
<DockPanel.Background>
<ImageBrush ImageSource="/topbar.png" TileMode="Tile" Stretch="UniformToFill" />
</DockPanel.Background>
<DockPanel DockPanel.Dock="Left" Width="400">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="/logon.png" ></Image>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock
HorizontalAlignment="left"
VerticalAlignment="Center"
FontSize="15"
Margin="10 0 0 0"
Text="{Binding Title}" />
</StackPanel>
</StackPanel>
</DockPanel>
<DockPanel DockPanel.Dock="Top" Height="18">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Name="btnMin" Style="{DynamicResource TopRightButtonStyle}" Margin="0,0,10,0" Click="btnMin_Click">
<WrapPanel>
<Image Source="/min1.png" />
</WrapPanel>
</Button>
<Button Name="btnMax" Style="{DynamicResource TopRightButtonStyle}" Margin="0,0,10,0" Click="btnMax_Click">
<WrapPanel>
<Image Source="/max2.png" Width="10" />
</WrapPanel>
</Button>
<Button Name="btnClose" Style="{DynamicResource TopRightButtonStyle}" Margin="0,0,10,0" Click="btnClose_Click">
<WrapPanel>
<Image Source="/close.png" />
</WrapPanel>
</Button>
</StackPanel>
</DockPanel>
<StackPanel Orientation="Horizontal">
<ToggleButton
x:Name="MenuToggleButton"
Style="{StaticResource MaterialDesignHamburgerToggleButton}"
IsChecked="False"
Command="{Binding ShowLeftDock}"
Width="24"
Height="24"
AutomationProperties.Name="HamburgerToggleButton" />
</StackPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" HorizontalAlignment="Right">
<Button
Name="btnVodieo"
Command="{Binding NavigateCommand}" CommandParameter="{x:Static names:ViewsName.CameraMonitorMain}"
Click="btnVodieo_Click"
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Background="#4c8bb7"
BorderBrush="Transparent"
materialDesign:ButtonAssist.CornerRadius="15"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Cursor="Hand">
<WrapPanel>
<Image Source="/camera1.png" Style="{DynamicResource TopButtonImgStyle}" />
<TextBlock Text="视频监控" VerticalAlignment="Center" Margin="6,0,0,0" />
</WrapPanel>
</Button>
<Button
Name="btnSet"
Command="{Binding NavigateCommand}" CommandParameter="{x:Static names:ViewsName.SystemSetMain}"
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Background="Transparent"
BorderBrush="Transparent"
materialDesign:ButtonAssist.CornerRadius="15"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Click="btnSet_Click" Cursor="Hand">
<WrapPanel>
<Image Source="/set1.png" Width="15" />
<TextBlock Text="系统设置" VerticalAlignment="Center" Margin="6,0,0,0" />
</WrapPanel>
</Button>
<materialDesign:PopupBox
DockPanel.Dock="Right"
PlacementMode="BottomAndAlignRightEdges"
StaysOpen="False">
<StackPanel>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Text="Light"
Margin="0 0 10 0" />
<ToggleButton
x:Name="DarkModeToggleButton"
Grid.Column="1" />
<TextBlock
Text="Dark"
Margin="10 0 0 0"
Grid.Column="2" />
<TextBlock
Text="Enabled"
Margin="0 10 10 0"
Grid.Row="1" />
</Grid>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
</DockPanel>
<ContentControl Grid.Row="1" prism:RegionManager.RegionName="{x:Static names:RegionsName.MainWindowCenter}" />
<materialDesign:Snackbar
x:Name="MainSnackbar"
MessageQueue="{materialDesign:MessageQueue}"
Grid.Row="1" />
</Grid>
</materialDesign:DialogHost>
</Window>