实现导航跳转

This commit is contained in:
2025-07-30 12:09:00 +08:00
parent 3b5ecef895
commit 1ebc1a4df6
21 changed files with 150 additions and 248 deletions

View File

@@ -27,11 +27,11 @@
</i:Interaction.Triggers>
<ui:ContentDialog.Resources>
<ex:EnumBindingSource x:Key="deviceType"
<ex:EnumBindingSource x:Key="DeviceType"
EnumType="{x:Type enums:DeviceType}" />
<ex:EnumBindingSource x:Key="protocolType"
<ex:EnumBindingSource x:Key="ProtocolType"
EnumType="{x:Type enums:ProtocolType}" />
<ex:EnumBindingSource x:Key="cpuType"
<ex:EnumBindingSource x:Key="CpuType"
EnumType="{x:Type enums:CpuType}" />
<vc:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
<vc:EnumToStringConverter x:Key="EnumToStringConverter" />
@@ -68,7 +68,7 @@
<ComboBox
IsEnabled="{Binding IsAddMode}"
SelectedItem="{Binding Device.DeviceType}"
ItemsSource="{Binding Source={StaticResource deviceType} }">
ItemsSource="{Binding Source={StaticResource DeviceType} }">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
@@ -107,7 +107,7 @@
<ComboBox x:Name="ProtocolComboBox"
IsEnabled="{Binding IsAddMode}"
SelectedItem="{Binding Device.Protocol}"
ItemsSource="{Binding Source={StaticResource protocolType} }">
ItemsSource="{Binding Source={StaticResource ProtocolType} }">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumDescriptionConverter}}" />
@@ -152,7 +152,7 @@
HorizontalAlignment="Left"
Style="{StaticResource TextBlockSubTitle}" />
<ComboBox SelectedItem="{Binding Device.CpuType}"
ItemsSource="{Binding Source={StaticResource cpuType}}" />
ItemsSource="{Binding Source={StaticResource CpuType}}" />
<!-- Rack -->
<TextBlock Text="机架号"

View File

@@ -59,7 +59,7 @@ public partial class MainView : Window
/// <param name="args"></param>
private async void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
var menu = args.SelectedItem as MenuBeanItemViewModel;
var menu = args.SelectedItem as MenuItemViewModel;
if (menu != null)
{
await _viewModel.MenuSelectionChanged(menu);

View File

@@ -131,23 +131,23 @@
OffContent="停用"
Toggled="OnIsActiveChanged"
FontSize="16"
IsOn="{Binding VariableTable.IsActive}" />
IsOn="{Binding CurrentVariableTable.IsActive}" />
<TextBlock Style="{StaticResource VarTableLabelStyle}"
Text="变量表名称:" />
<TextBlock Style="{StaticResource VarTableValueStyle}"
Text="{Binding VariableTable.Name}" />
Text="{Binding CurrentVariableTable.Name}" />
<TextBlock Style="{StaticResource VarTableLabelStyle}"
Text="变量表描述:" />
<TextBlock Style="{StaticResource VarTableValueStyle}"
Text="{Binding VariableTable.Description}" />
Text="{Binding CurrentVariableTable.Description}" />
<TextBlock Style="{StaticResource VarTableLabelStyle}"
Text="所属设备:" />
<TextBlock Style="{StaticResource VarTableValueStyle}"
Text="{Binding VariableTable.Device.Name}" />
Text="{Binding CurrentVariableTable.Device.Name}" />
<TextBlock Style="{StaticResource VarTableLabelStyle}"
Text="协议:" />
<TextBlock Style="{StaticResource VarTableValueStyle}"
Text="{Binding VariableTable.ProtocolType}" />
Text="{Binding CurrentVariableTable.Protocol}" />
<TextBlock Style="{StaticResource VarTableLabelStyle}"
Text="搜索:" />
<TextBox Width="200"