2025-09-11 11:04:07 +08:00
|
|
|
<UserControl
|
|
|
|
|
x:Class="DMS.WPF.Views.VariableHistoryView"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:controls="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:enums="clr-namespace:DMS.Core.Enums;assembly=DMS.Core"
|
|
|
|
|
xmlns:ex="clr-namespace:DMS.Extensions"
|
|
|
|
|
xmlns:helper="clr-namespace:DMS.WPF.Helper"
|
|
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
|
|
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:valueConverts="clr-namespace:DMS.WPF.ValueConverts"
|
|
|
|
|
xmlns:vm="clr-namespace:DMS.WPF.ViewModels"
|
|
|
|
|
d:DataContext="{d:DesignInstance vm:VariableHistoryViewModel}"
|
|
|
|
|
d:DesignHeight="600"
|
|
|
|
|
d:DesignWidth="800"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
<UserControl.Resources>
|
|
|
|
|
<ex:BindingProxy x:Key="proxy" Data="{Binding}" />
|
|
|
|
|
<valueConverts:EnumDescriptionConverter x:Key="EnumDescriptionConverter" />
|
|
|
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
|
|
|
|
|
|
|
|
<!-- 标签字体的样式 -->
|
|
|
|
|
<Style x:Key="VarHistoryLabelStyle" TargetType="TextBlock">
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource SecondaryTextBrush}" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
</Style>
|
|
|
|
|
<!-- 值字体的样式 -->
|
|
|
|
|
<Style x:Key="VarHistoryValueStyle" TargetType="TextBlock">
|
|
|
|
|
<Setter Property="FontWeight" Value="Bold" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
<Setter Property="MinWidth" Value="100" />
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
</Style>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
|
|
|
|
|
<DockPanel>
|
|
|
|
|
<ikw:SimpleStackPanel Margin="10" DockPanel.Dock="Top">
|
2025-09-11 18:09:35 +08:00
|
|
|
<!-- 搜索区域 -->
|
|
|
|
|
<GroupBox Header="搜索条件">
|
2025-09-11 11:04:07 +08:00
|
|
|
<ikw:SimpleStackPanel Margin="5" Spacing="10">
|
|
|
|
|
<ikw:SimpleStackPanel
|
2025-09-11 18:09:35 +08:00
|
|
|
HorizontalAlignment="Left"
|
2025-09-11 11:04:07 +08:00
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="10">
|
|
|
|
|
<TextBlock Style="{StaticResource VarHistoryLabelStyle}" Text="搜索变量:" />
|
2025-09-11 18:09:35 +08:00
|
|
|
<ui:AutoSuggestBox
|
2025-09-11 11:04:07 +08:00
|
|
|
Width="200"
|
|
|
|
|
ui:ControlHelper.PlaceholderText="搜索变量..."
|
2025-09-11 18:09:35 +08:00
|
|
|
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
ItemsSource="{Binding SuggestedVariables}"
|
|
|
|
|
DisplayMemberPath="VariableName"
|
|
|
|
|
IsSuggestionListOpen="{Binding IsSuggestionListOpen, Mode=TwoWay}"
|
|
|
|
|
TextMemberPath="VariableName" />
|
2025-09-11 11:04:07 +08:00
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</GroupBox>
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
|
|
|
|
|
<DataGrid
|
|
|
|
|
Margin="10"
|
|
|
|
|
AutoGenerateColumns="False"
|
|
|
|
|
CanUserDeleteRows="False"
|
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
|
IsReadOnly="True"
|
|
|
|
|
ItemsSource="{Binding VariableHistories}"
|
|
|
|
|
SelectionMode="Single"
|
|
|
|
|
Style="{StaticResource DataGridBaseStyle}">
|
|
|
|
|
<DataGrid.Columns>
|
2025-09-11 18:09:35 +08:00
|
|
|
<DataGridTextColumn Binding="{Binding VariableName}" Header="变量名" />
|
2025-09-11 11:04:07 +08:00
|
|
|
<DataGridTextColumn Binding="{Binding Value}" Header="值" />
|
|
|
|
|
<DataGridTextColumn
|
|
|
|
|
Binding="{Binding Timestamp, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss.fff}'}"
|
|
|
|
|
Header="时间戳"
|
|
|
|
|
IsReadOnly="True" />
|
|
|
|
|
</DataGrid.Columns>
|
|
|
|
|
</DataGrid>
|
|
|
|
|
</DockPanel>
|
|
|
|
|
</UserControl>
|