2025-06-10 20:55:39 +08:00
|
|
|
<UserControl x:Class="PMSWPF.Views.DevicesView"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2025-06-13 18:54:17 +08:00
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
2025-06-12 13:15:55 +08:00
|
|
|
xmlns:vm="clr-namespace:PMSWPF.ViewModels"
|
|
|
|
|
d:DataContext="{d:DesignInstance vm:DevicesViewModel}"
|
2025-06-10 20:55:39 +08:00
|
|
|
mc:Ignorable="d"
|
2025-07-01 21:34:20 +08:00
|
|
|
d:DesignHeight="300"
|
|
|
|
|
d:DesignWidth="300">
|
2025-06-22 21:00:06 +08:00
|
|
|
<UserControl.Resources>
|
|
|
|
|
<DataTemplate x:Key="DeviceItemTemplate">
|
2025-07-01 21:34:20 +08:00
|
|
|
<Border Background="#eee"
|
|
|
|
|
CornerRadius="10"
|
|
|
|
|
Margin="3"
|
|
|
|
|
Padding="10">
|
|
|
|
|
<ikw:SimpleStackPanel Spacing="10"
|
|
|
|
|
Width="300"
|
|
|
|
|
Height="200">
|
2025-06-23 17:01:06 +08:00
|
|
|
<DockPanel>
|
2025-07-01 21:34:20 +08:00
|
|
|
<ui:ToggleSwitch DockPanel.Dock="Right"
|
|
|
|
|
Margin="20 0 0 0 "
|
2025-07-02 18:33:08 +08:00
|
|
|
IsOn="{Binding IsFirstLoad}"
|
2025-07-01 21:34:20 +08:00
|
|
|
OffContent="停止"
|
|
|
|
|
OnContent="启动" />
|
|
|
|
|
<TextBlock FontSize="24"
|
|
|
|
|
FontWeight="Bold"
|
|
|
|
|
Text="{Binding Name }" />
|
2025-06-22 21:00:06 +08:00
|
|
|
</DockPanel>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
2025-06-22 21:00:06 +08:00
|
|
|
<TextBlock Text="{Binding Description }" />
|
|
|
|
|
<TextBlock Text="{Binding Ip }" />
|
2025-06-23 17:01:06 +08:00
|
|
|
<ListBox ItemsSource="{Binding VariableTables }">
|
|
|
|
|
<ListBox.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<Button Content="{Binding Name}" />
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ListBox.ItemTemplate>
|
2025-06-22 21:00:06 +08:00
|
|
|
</ListBox>
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</Border>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
2025-06-22 21:00:06 +08:00
|
|
|
</DataTemplate>
|
|
|
|
|
</UserControl.Resources>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
|
|
|
|
<StackPanel>
|
2025-07-01 21:34:20 +08:00
|
|
|
<!-- 操作菜单栏 -->
|
|
|
|
|
<ui:CommandBar DefaultLabelPosition="Right"
|
|
|
|
|
IsOpen="False">
|
|
|
|
|
<!-- 添加设备 -->
|
|
|
|
|
<ui:AppBarButton Command="{Binding AddDeviceCommand}"
|
|
|
|
|
Label="添加设备">
|
2025-06-22 21:00:06 +08:00
|
|
|
<ui:AppBarButton.Icon>
|
2025-06-23 17:01:06 +08:00
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Add}" />
|
2025-06-22 21:00:06 +08:00
|
|
|
</ui:AppBarButton.Icon>
|
|
|
|
|
</ui:AppBarButton>
|
2025-07-01 21:34:20 +08:00
|
|
|
<!-- 编辑设备 -->
|
|
|
|
|
<ui:AppBarButton Command="{Binding EditDeviceCommand}"
|
|
|
|
|
Label="编辑设备">
|
2025-06-22 21:00:06 +08:00
|
|
|
<ui:AppBarButton.Icon>
|
2025-06-23 17:01:06 +08:00
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Edit}" />
|
2025-06-22 21:00:06 +08:00
|
|
|
</ui:AppBarButton.Icon>
|
2025-07-01 21:34:20 +08:00
|
|
|
</ui:AppBarButton>
|
|
|
|
|
<!-- 编辑设备 -->
|
|
|
|
|
<ui:AppBarButton Command="{Binding DeleteDeviceCommand}"
|
|
|
|
|
Label="删除设备">
|
|
|
|
|
<ui:AppBarButton.Icon>
|
|
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Delete}" />
|
|
|
|
|
</ui:AppBarButton.Icon>
|
2025-06-22 21:00:06 +08:00
|
|
|
</ui:AppBarButton>
|
|
|
|
|
<ui:AppBarButton x:Name="ShareButton"
|
2025-06-23 17:01:06 +08:00
|
|
|
Label="Share">
|
2025-06-22 21:00:06 +08:00
|
|
|
<ui:AppBarButton.Icon>
|
2025-06-23 17:01:06 +08:00
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Share}" />
|
2025-06-22 21:00:06 +08:00
|
|
|
</ui:AppBarButton.Icon>
|
|
|
|
|
</ui:AppBarButton>
|
|
|
|
|
<ui:CommandBar.SecondaryCommands>
|
|
|
|
|
<ui:AppBarButton x:Name="SettingsButton"
|
2025-07-01 21:34:20 +08:00
|
|
|
Icon="Setting"
|
|
|
|
|
Label="Settings" />
|
2025-06-22 21:00:06 +08:00
|
|
|
</ui:CommandBar.SecondaryCommands>
|
|
|
|
|
</ui:CommandBar>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
|
|
|
|
|
2025-06-13 18:54:17 +08:00
|
|
|
<ui:GridView x:Name="BasicGridView"
|
2025-06-20 18:53:29 +08:00
|
|
|
Margin="20"
|
2025-06-13 18:54:17 +08:00
|
|
|
IsItemClickEnabled="True"
|
2025-07-01 21:34:20 +08:00
|
|
|
SelectedItem="{Binding SelectedDevice }"
|
2025-06-13 18:54:17 +08:00
|
|
|
ItemsSource="{Binding Devices}"
|
|
|
|
|
ItemTemplate="{StaticResource DeviceItemTemplate}"
|
|
|
|
|
SelectionMode="Single" />
|
2025-06-10 22:13:06 +08:00
|
|
|
</StackPanel>
|
2025-06-23 17:01:06 +08:00
|
|
|
|
|
|
|
|
</UserControl>
|