51 lines
3.0 KiB
Plaintext
51 lines
3.0 KiB
Plaintext
|
|
<Page x:Class="DMS.WPF.Views.Triggers.TriggersView"
|
||
|
|
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"
|
||
|
|
xmlns:local="clr-namespace:DMS.WPF.Views.Triggers"
|
||
|
|
xmlns:viewmodels="clr-namespace:DMS.WPF.ViewModels.Triggers;assembly=DMS.WPF"
|
||
|
|
mc:Ignorable="d"
|
||
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
||
|
|
Title="TriggersView">
|
||
|
|
<Page.DataContext>
|
||
|
|
<viewmodels:TriggersViewModel />
|
||
|
|
</Page.DataContext>
|
||
|
|
|
||
|
|
<Grid Margin="10">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto"/>
|
||
|
|
<RowDefinition Height="*"/>
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<!-- Toolbar -->
|
||
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
|
||
|
|
<Button Content="添加" Command="{Binding AddTriggerCommand}" Margin="0,0,5,0"/>
|
||
|
|
<Button Content="编辑" Command="{Binding EditTriggerCommand}" Margin="0,0,5,0"/>
|
||
|
|
<Button Content="删除" Command="{Binding DeleteTriggerCommand}" Margin="0,0,5,0"/>
|
||
|
|
<Button Content="刷新" Command="{Binding LoadTriggersCommand}" Margin="0,0,5,0"/>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<!-- Triggers List -->
|
||
|
|
<DataGrid Grid.Row="1"
|
||
|
|
ItemsSource="{Binding Triggers}"
|
||
|
|
SelectedItem="{Binding SelectedTrigger}"
|
||
|
|
AutoGenerateColumns="False"
|
||
|
|
IsReadOnly="True"
|
||
|
|
SelectionMode="Single">
|
||
|
|
<DataGrid.Columns>
|
||
|
|
<DataGridTextColumn Header="描述" Binding="{Binding Description}" Width="*" />
|
||
|
|
<DataGridTextColumn Header="变量ID" Binding="{Binding VariableId}" Width="150" />
|
||
|
|
<DataGridTextColumn Header="条件" Binding="{Binding Condition}" Width="100" />
|
||
|
|
<DataGridTextColumn Header="阈值/范围" Binding="{Binding Threshold, StringFormat='{}{0:N2}'}" Width="100" />
|
||
|
|
<DataGridTextColumn Header="下限" Binding="{Binding LowerBound, StringFormat='{}{0:N2}'}" Width="100" />
|
||
|
|
<DataGridTextColumn Header="上限" Binding="{Binding UpperBound, StringFormat='{}{0:N2}'}" Width="100" />
|
||
|
|
<DataGridTextColumn Header="动作" Binding="{Binding Action}" Width="100" />
|
||
|
|
<DataGridTextColumn Header="激活" Binding="{Binding IsActive}" Width="60" />
|
||
|
|
<DataGridTextColumn Header="最后触发" Binding="{Binding LastTriggeredAt, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Width="150" />
|
||
|
|
<DataGridTextColumn Header="创建时间" Binding="{Binding CreatedAt, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Width="150" />
|
||
|
|
<DataGridTextColumn Header="更新时间" Binding="{Binding UpdatedAt, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Width="150" />
|
||
|
|
</DataGrid.Columns>
|
||
|
|
</DataGrid>
|
||
|
|
</Grid>
|
||
|
|
</Page>
|