2025-08-24 11:31:07 +08:00
|
|
|
<Window
|
|
|
|
|
x:Class="DMS.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:hc="https://handyorg.github.io/handycontrol"
|
|
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
|
|
xmlns:local="clr-namespace:DMS.WPF.Views"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:mo="clr-namespace:DMS.Core.Models;assembly=DMS.Core"
|
|
|
|
|
xmlns:taskbarNotification="http://www.hardcodet.net/taskbar"
|
|
|
|
|
xmlns:tb="http://hardcodet.net/taskbar"
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:vm="clr-namespace:DMS.WPF.ViewModels"
|
|
|
|
|
Title="设备管理系统"
|
|
|
|
|
Width="1080"
|
|
|
|
|
Height="800"
|
|
|
|
|
d:DataContext="{d:DesignInstance vm:MainViewModel}"
|
|
|
|
|
ui:WindowHelper.SystemBackdropType="Mica"
|
|
|
|
|
ui:WindowHelper.UseModernWindowStyle="True"
|
|
|
|
|
Closing="Window_Closing"
|
|
|
|
|
Loaded="MainView_OnLoaded"
|
|
|
|
|
WindowStartupLocation="CenterScreen"
|
|
|
|
|
WindowState="Maximized"
|
|
|
|
|
mc:Ignorable="d">
|
2025-06-25 22:33:57 +08:00
|
|
|
<Window.Resources>
|
2025-07-02 12:01:20 +08:00
|
|
|
|
|
|
|
|
<ContextMenu x:Key="MyMenuItemContextMenu">
|
|
|
|
|
<MenuItem Header="添加" />
|
|
|
|
|
<MenuItem Header="编辑" />
|
|
|
|
|
<Separator />
|
|
|
|
|
<MenuItem Header="删除" />
|
|
|
|
|
</ContextMenu>
|
2025-08-24 11:31:07 +08:00
|
|
|
<DataTemplate x:Key="NavigationViewMenuItem" DataType="{x:Type mo:MenuBean}">
|
|
|
|
|
<ui:NavigationViewItem
|
|
|
|
|
Content="{Binding Header}"
|
|
|
|
|
MenuItemsSource="{Binding Children}"
|
|
|
|
|
Tag="{Binding}">
|
2025-06-25 22:33:57 +08:00
|
|
|
<ui:NavigationViewItem.Icon>
|
|
|
|
|
<ui:FontIcon Glyph="{Binding Icon}" />
|
|
|
|
|
</ui:NavigationViewItem.Icon>
|
|
|
|
|
</ui:NavigationViewItem>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</Window.Resources>
|
2025-06-10 20:55:39 +08:00
|
|
|
<Grid>
|
2025-08-24 11:31:07 +08:00
|
|
|
<taskbarNotification:TaskbarIcon
|
|
|
|
|
x:Name="MyNotifyIcon"
|
|
|
|
|
DoubleClickCommand="{Binding ShowWindowCommand}"
|
|
|
|
|
IconSource="/Assets/AppIcon2.ico"
|
|
|
|
|
ToolTipText="设备管理系统">
|
2025-07-07 14:01:37 +08:00
|
|
|
<taskbarNotification:TaskbarIcon.ContextMenu>
|
|
|
|
|
<ContextMenu>
|
2025-08-24 18:29:26 +08:00
|
|
|
<MenuItem x:Name="ShowWindowMenuItem" Header="显示窗口" />
|
|
|
|
|
<MenuItem x:Name="ExitApplicationMenuItem" Header="退出" />
|
2025-07-07 14:01:37 +08:00
|
|
|
</ContextMenu>
|
|
|
|
|
</taskbarNotification:TaskbarIcon.ContextMenu>
|
|
|
|
|
</taskbarNotification:TaskbarIcon>
|
2025-08-24 11:31:07 +08:00
|
|
|
<ui:NavigationView
|
|
|
|
|
AlwaysShowHeader="True"
|
|
|
|
|
ExpandedModeThresholdWidth="500"
|
|
|
|
|
IsBackButtonVisible="Collapsed"
|
|
|
|
|
IsBackEnabled="False"
|
|
|
|
|
IsSettingsVisible="False"
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
MenuItemTemplate="{StaticResource NavigationViewMenuItem}"
|
2025-09-09 13:35:16 +08:00
|
|
|
MenuItemsSource="{Binding MenuTrees}"
|
2025-08-24 11:31:07 +08:00
|
|
|
PaneDisplayMode="Left"
|
|
|
|
|
PaneTitle="设备管理系统"
|
|
|
|
|
SelectionChanged="NavigationView_SelectionChanged"
|
|
|
|
|
SelectionFollowsFocus="Disabled">
|
|
|
|
|
|
2025-07-07 14:01:37 +08:00
|
|
|
|
2025-05-29 08:58:58 +08:00
|
|
|
|
2025-06-10 20:55:39 +08:00
|
|
|
<ui:NavigationView.AutoSuggestBox>
|
|
|
|
|
<ui:AutoSuggestBox AutomationProperties.Name="Search">
|
|
|
|
|
<ui:AutoSuggestBox.QueryIcon>
|
|
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Search}" />
|
|
|
|
|
</ui:AutoSuggestBox.QueryIcon>
|
|
|
|
|
</ui:AutoSuggestBox>
|
|
|
|
|
</ui:NavigationView.AutoSuggestBox>
|
|
|
|
|
|
|
|
|
|
|
2025-06-14 19:34:12 +08:00
|
|
|
<Grid>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 数据模版绑定不同的View显示 -->
|
2025-06-14 19:34:12 +08:00
|
|
|
<ContentControl Content="{Binding CurrentViewModel}">
|
|
|
|
|
<ContentControl.Resources>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 主页 -->
|
2025-06-14 19:34:12 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:HomeViewModel}">
|
2025-06-23 17:01:06 +08:00
|
|
|
<local:HomeView />
|
2025-06-14 19:34:12 +08:00
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 设备列表页 -->
|
2025-06-14 19:34:12 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:DevicesViewModel}">
|
2025-06-23 17:01:06 +08:00
|
|
|
<local:DevicesView />
|
2025-06-14 19:34:12 +08:00
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 数据转换页 -->
|
2025-06-14 19:34:12 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:DataTransformViewModel}">
|
2025-06-23 17:01:06 +08:00
|
|
|
<local:DataTransformView />
|
2025-06-14 19:34:12 +08:00
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- Mqtt服务器页 -->
|
2025-07-04 23:34:54 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:MqttsViewModel}">
|
|
|
|
|
<local:MqttsView />
|
|
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 设置页 -->
|
2025-06-23 13:42:02 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:SettingViewModel}">
|
2025-06-23 17:01:06 +08:00
|
|
|
<local:SettingView />
|
2025-06-23 13:42:02 +08:00
|
|
|
</DataTemplate>
|
2025-09-07 19:48:48 +08:00
|
|
|
<!-- 日志历史页 -->
|
|
|
|
|
<DataTemplate DataType="{x:Type vm:LogHistoryViewModel}">
|
|
|
|
|
<local:LogHistoryView />
|
|
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 设备详情页 -->
|
2025-06-30 14:19:22 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:DeviceDetailViewModel}">
|
2025-08-24 11:31:07 +08:00
|
|
|
<local:DeviceDetailView />
|
2025-06-30 14:19:22 +08:00
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- 设备变量页 -->
|
2025-06-30 14:19:22 +08:00
|
|
|
<DataTemplate DataType="{x:Type vm:VariableTableViewModel}">
|
2025-08-24 11:31:07 +08:00
|
|
|
<local:VariableTableView DataContext="{Binding}" />
|
2025-06-30 14:19:22 +08:00
|
|
|
</DataTemplate>
|
2025-09-11 11:04:07 +08:00
|
|
|
<!-- 设备变量历史记录页 -->
|
|
|
|
|
<DataTemplate DataType="{x:Type vm:VariableHistoryViewModel}">
|
|
|
|
|
<local:VariableHistoryView DataContext="{Binding}" />
|
|
|
|
|
</DataTemplate>
|
2025-08-24 11:31:07 +08:00
|
|
|
<!-- Mqtt服务器详情页 -->
|
2025-07-26 10:05:43 +08:00
|
|
|
<!-- <DataTemplate DataType="{x:Type vm:MqttServerDetailViewModel}"> -->
|
|
|
|
|
<!-- <local:MqttServerDetailView DataContext="{Binding }"/> -->
|
|
|
|
|
<!-- </DataTemplate> -->
|
2025-06-14 19:34:12 +08:00
|
|
|
</ContentControl.Resources>
|
|
|
|
|
</ContentControl>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
2025-08-24 11:31:07 +08:00
|
|
|
<ScrollViewer HorizontalAlignment="Right" VerticalScrollBarVisibility="Hidden">
|
|
|
|
|
<StackPanel
|
|
|
|
|
Margin="0,10,10,10"
|
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
|
hc:Growl.GrowlParent="True" />
|
2025-06-14 19:34:12 +08:00
|
|
|
</ScrollViewer>
|
|
|
|
|
</Grid>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
2025-06-10 20:55:39 +08:00
|
|
|
</ui:NavigationView>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|