2024-11-13 17:09:15 +08:00
|
|
|
<Window xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:vm="using:detect.gui.ViewModels"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:controls="clr-namespace:detect.gui.Controls"
|
|
|
|
xmlns:reactiveUi="http://reactiveui.net"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="detect.gui.Views.MainView"
|
|
|
|
x:DataType="vm:MainViewModel"
|
|
|
|
Closing="OnClosing">
|
|
|
|
<Window.Background>
|
|
|
|
<ImageBrush Source="avares://detect.gui/Assets/Images/bg.png" Stretch="Fill" />
|
|
|
|
</Window.Background>
|
|
|
|
<Grid RowDefinitions="Auto, Auto, 0, *">
|
|
|
|
<Border Height="70">
|
|
|
|
<Border.Background>
|
|
|
|
<ImageBrush Source="avares://detect.gui/Assets/Images/header.png" Stretch="None" />
|
|
|
|
</Border.Background>
|
|
|
|
<Grid>
|
|
|
|
<Border>
|
|
|
|
<TextBlock Classes="logo-text" Text="中核集团预埋件检测系统" VerticalAlignment="Center">
|
|
|
|
<TextBlock.Foreground>
|
|
|
|
<LinearGradientBrush StartPoint="0% 0%" EndPoint="0% 100%">
|
|
|
|
<GradientStop Offset="0.0" Color="#34DEFC" />
|
|
|
|
<GradientStop Offset="0.5" Color="#FFFFFF" />
|
|
|
|
<GradientStop Offset="1.0" Color="#34DEFC" />
|
|
|
|
</LinearGradientBrush>
|
|
|
|
</TextBlock.Foreground>
|
|
|
|
</TextBlock>
|
|
|
|
<Border.Background>
|
|
|
|
<LinearGradientBrush StartPoint="0% 0%" EndPoint="0% 100%" Opacity="0.25">
|
|
|
|
<GradientStop Offset="0.8" Color="Transparent" />
|
|
|
|
<GradientStop Offset="1.0" Color="#34DEFC" />
|
|
|
|
</LinearGradientBrush>
|
|
|
|
</Border.Background>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
<Border Grid.Row="1" Height="4">
|
|
|
|
<Border.Background>
|
|
|
|
<LinearGradientBrush StartPoint="0% 0%" EndPoint="100% 0%">
|
|
|
|
<GradientStop Offset="0.0" Color="#2F1A9A" />
|
|
|
|
<GradientStop Offset="0.3" Color="#3A62CB" />
|
|
|
|
<GradientStop Offset="0.5" Color="#34DEFC" />
|
|
|
|
<GradientStop Offset="0.7" Color="#3A62CB" />
|
|
|
|
<GradientStop Offset="1" Color="#2F1A9A" />
|
|
|
|
</LinearGradientBrush>
|
|
|
|
</Border.Background>
|
|
|
|
</Border>
|
|
|
|
<Grid Grid.Row="0" HorizontalAlignment="Right" ColumnDefinitions="Auto,5,Auto,5,Auto,5,Auto,15">
|
|
|
|
<Button Grid.Column="0"
|
|
|
|
Classes="icon-button circle logout window"
|
|
|
|
ToolTip.Tip="注销"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsVisible="{Binding CurrentUser, Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
|
|
Command="{Binding LogoutCommand}">
|
|
|
|
</Button>
|
|
|
|
<Button Grid.Column="2"
|
|
|
|
Classes="icon-button circle min window"
|
|
|
|
ToolTip.Tip="最小化"
|
|
|
|
Click="MinClick"/>
|
|
|
|
<Button Grid.Column="4"
|
|
|
|
IsEnabled="False"
|
|
|
|
IsVisible="{Binding $parent[Window;0].WindowState, Converter={StaticResource WindowStateConverter}, ConverterParameter=2}"
|
|
|
|
Classes="icon-button circle max window"
|
|
|
|
CornerRadius="100"
|
|
|
|
ToolTip.Tip="最大化"
|
|
|
|
Click="MaxClick"/>
|
|
|
|
<Button Grid.Column="4"
|
|
|
|
Classes="icon-button circle restore window"
|
|
|
|
ToolTip.Tip="恢复"
|
|
|
|
IsEnabled="False"
|
|
|
|
IsVisible="{Binding $parent[Window;0].WindowState, Converter={StaticResource WindowStateConverter}, ConverterParameter=1}"
|
|
|
|
Click="RestoreClick"/>
|
|
|
|
<Button Grid.Column="6"
|
|
|
|
Classes="icon-button circle close window"
|
|
|
|
ToolTip.Tip="关闭"
|
|
|
|
Click="CloseClick"/>
|
|
|
|
</Grid>
|
|
|
|
<Border Grid.Row="3">
|
|
|
|
<Border.Margin>
|
|
|
|
<MultiBinding Converter="{StaticResource SidebarMarginConverter}">
|
|
|
|
<Binding Path="CurrentUser" />
|
|
|
|
<Binding Path="#Sidebar.Bounds.Height" />
|
|
|
|
</MultiBinding>
|
|
|
|
</Border.Margin>
|
2024-11-14 17:11:43 +08:00
|
|
|
<reactiveUi:RoutedViewHost Router="{Binding Router}" Name="RoutedViewHost">
|
2024-11-13 17:09:15 +08:00
|
|
|
<reactiveUi:RoutedViewHost.DefaultContent />
|
|
|
|
</reactiveUi:RoutedViewHost>
|
|
|
|
</Border>
|
|
|
|
<Grid Grid.Row="3" x:Name="Sidebar" VerticalAlignment="Bottom" IsVisible="{Binding CurrentUser, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
|
|
<Grid.Background>
|
|
|
|
<SolidColorBrush Color="#2D77F3" Opacity="0.4"></SolidColorBrush>
|
|
|
|
</Grid.Background>
|
|
|
|
<Border Margin="0, 10" HorizontalAlignment="Center">
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<RadioButton Classes="sidebar home-app" Content="首页" GroupName="SideBar" IsChecked="{Binding IsHomeView}" Command="{Binding GotoCommand}" CommandParameter="HomeViewModel" />
|
|
|
|
<Border Width="15" />
|
2024-11-13 17:26:19 +08:00
|
|
|
<RadioButton Classes="sidebar home-task" Content="任务管理" GroupName="SideBar" IsChecked="{Binding IsDetectTaskView}" Command="{Binding GotoCommand}" CommandParameter="DetectTaskViewModel" />
|
2024-11-13 17:09:15 +08:00
|
|
|
<Border Width="15" />
|
2024-11-13 17:26:19 +08:00
|
|
|
<RadioButton Classes="sidebar home-device" Content="设备管理" GroupName="SideBar" IsChecked="{Binding IsDeviceView}" Command="{Binding GotoCommand}" CommandParameter="DeviceViewModel" />
|
2024-11-13 17:09:15 +08:00
|
|
|
<Border Width="15" />
|
2024-11-13 17:26:19 +08:00
|
|
|
<RadioButton Classes="sidebar home-log" Content="日志查看" GroupName="SideBar" IsChecked="{Binding IsLogView}" Command="{Binding GotoCommand}" CommandParameter="LogViewModel" />
|
2024-11-13 17:09:15 +08:00
|
|
|
<Border Width="15" />
|
2024-11-13 17:26:19 +08:00
|
|
|
<RadioButton Classes="sidebar home-user" Content="用户管理" GroupName="SideBar" IsChecked="{Binding IsUserView}" Command="{Binding GotoCommand}" CommandParameter="UserViewModel" />
|
2024-11-13 17:09:15 +08:00
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
<controls:ProgressBox Grid.Row="2"
|
|
|
|
IconWidth="64"
|
|
|
|
IconHeight="64"
|
|
|
|
Foreground="{StaticResource Orange}"
|
|
|
|
IsVisible="{Binding IsLoading}" />
|
|
|
|
</Grid>
|
|
|
|
</Window>
|