165 lines
7.9 KiB
Plaintext
165 lines
7.9 KiB
Plaintext
|
|
<UserControl
|
||
|
|
x:Class="Plugin.Cowain.Wcs.Views.ProcessManagement6180View"
|
||
|
|
xmlns="https://github.com/avaloniaui"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:conv="using:Cowain.Base.Converters"
|
||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
|
|
xmlns:extensions="using:Cowain.Base.Extensions"
|
||
|
|
xmlns:i18n="clr-namespace:Ke.Bee.Localization.Extensions;assembly=Ke.Bee.Localization"
|
||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
|
|
xmlns:semi="https://irihi.tech/semi"
|
||
|
|
xmlns:u="https://irihi.tech/ursa"
|
||
|
|
xmlns:vm="using:Plugin.Cowain.Wcs.ViewModels"
|
||
|
|
d:DesignHeight="450"
|
||
|
|
d:DesignWidth="800"
|
||
|
|
mc:Ignorable="d">
|
||
|
|
<UserControl.Resources>
|
||
|
|
<conv:I18nLocalizeConverter x:Key="i18nConverter" />
|
||
|
|
</UserControl.Resources>
|
||
|
|
<Grid RowDefinitions="Auto * Auto">
|
||
|
|
<StackPanel
|
||
|
|
Grid.Row="0"
|
||
|
|
Margin="10,8"
|
||
|
|
Orientation="Horizontal"
|
||
|
|
Spacing="10">
|
||
|
|
<u:IconButton
|
||
|
|
Command="{Binding AddCommand}"
|
||
|
|
IsEnabled="{extensions:MenuEnable ProcessManagement6180View,
|
||
|
|
add}"
|
||
|
|
Theme="{DynamicResource BorderlessIconButton}"
|
||
|
|
ToolTip.Tip="{i18n:Localize ProcessManagement.Tooltip.Add}">
|
||
|
|
<u:IconButton.Icon>
|
||
|
|
<PathIcon
|
||
|
|
Width="16"
|
||
|
|
Height="16"
|
||
|
|
Data="{StaticResource SemiIconPlusStroked}" />
|
||
|
|
</u:IconButton.Icon>
|
||
|
|
</u:IconButton>
|
||
|
|
<u:IconButton
|
||
|
|
Command="{Binding RefreshCommand}"
|
||
|
|
CommandParameter="{Binding #page.CurrentPage}"
|
||
|
|
Theme="{DynamicResource BorderlessIconButton}"
|
||
|
|
ToolTip.Tip="{i18n:Localize ProcessManagement.Tooltip.Refresh}">
|
||
|
|
<u:IconButton.Icon>
|
||
|
|
<PathIcon
|
||
|
|
Width="16"
|
||
|
|
Height="16"
|
||
|
|
Data="{StaticResource SemiIconRedoStroked}" />
|
||
|
|
</u:IconButton.Icon>
|
||
|
|
</u:IconButton>
|
||
|
|
</StackPanel>
|
||
|
|
|
||
|
|
<DataGrid
|
||
|
|
Grid.Row="1"
|
||
|
|
CanUserReorderColumns="True"
|
||
|
|
CanUserResizeColumns="True"
|
||
|
|
CanUserSortColumns="True"
|
||
|
|
FrozenColumnCount="2"
|
||
|
|
HeadersVisibility="All"
|
||
|
|
HorizontalScrollBarVisibility="Auto"
|
||
|
|
ItemsSource="{Binding ProcessList}"
|
||
|
|
RowHeight="30">
|
||
|
|
<DataGrid.Columns>
|
||
|
|
<DataGridTextColumn
|
||
|
|
Width="60"
|
||
|
|
x:DataType="vm:ProcessViewModel"
|
||
|
|
Binding="{Binding Id}"
|
||
|
|
Header="{i18n:Localize ProcessManagement.DataGrid.Id}"
|
||
|
|
IsReadOnly="True" />
|
||
|
|
|
||
|
|
<DataGridTemplateColumn Width="140" Header="{i18n:Localize ProcessManagement.DataGrid.Edit}">
|
||
|
|
<DataGridTemplateColumn.CellTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||
|
|
<u:IconButton
|
||
|
|
x:CompileBindings="False"
|
||
|
|
Command="{Binding $parent[DataGrid].DataContext.SaveCommand}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
IsEnabled="{extensions:MenuEnable ProcessManagement6180View,
|
||
|
|
save}"
|
||
|
|
Theme="{DynamicResource BorderlessIconButton}"
|
||
|
|
ToolTip.Tip="{i18n:Localize ProcessManagement.Tooltip.Save}">
|
||
|
|
<u:IconButton.Icon>
|
||
|
|
<PathIcon
|
||
|
|
Width="16"
|
||
|
|
Height="16"
|
||
|
|
Data="{StaticResource SemiIconSave}" />
|
||
|
|
</u:IconButton.Icon>
|
||
|
|
</u:IconButton>
|
||
|
|
<u:IconButton
|
||
|
|
x:CompileBindings="False"
|
||
|
|
Command="{Binding $parent[DataGrid].DataContext.EditCommand}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
IsEnabled="{extensions:MenuEnable ProcessManagement6180View,
|
||
|
|
edit}"
|
||
|
|
Theme="{DynamicResource BorderlessIconButton}"
|
||
|
|
ToolTip.Tip="{i18n:Localize ProcessManagement.Tooltip.Edit}">
|
||
|
|
<u:IconButton.Icon>
|
||
|
|
<PathIcon
|
||
|
|
Width="16"
|
||
|
|
Height="16"
|
||
|
|
Data="{StaticResource SemiIconEdit2Stroked}" />
|
||
|
|
</u:IconButton.Icon>
|
||
|
|
</u:IconButton>
|
||
|
|
<u:IconButton
|
||
|
|
x:CompileBindings="False"
|
||
|
|
Command="{Binding $parent[DataGrid].DataContext.DeleteCommand}"
|
||
|
|
CommandParameter="{Binding}"
|
||
|
|
IsEnabled="{extensions:MenuEnable ProcessManagement6180View,
|
||
|
|
delete}"
|
||
|
|
Theme="{DynamicResource BorderlessIconButton}"
|
||
|
|
ToolTip.Tip="{i18n:Localize ProcessManagement.Tooltip.Delete}">
|
||
|
|
<u:IconButton.Icon>
|
||
|
|
<PathIcon
|
||
|
|
Width="16"
|
||
|
|
Height="16"
|
||
|
|
Data="{StaticResource SemiIconDeleteStroked}" />
|
||
|
|
</u:IconButton.Icon>
|
||
|
|
</u:IconButton>
|
||
|
|
</StackPanel>
|
||
|
|
</DataTemplate>
|
||
|
|
</DataGridTemplateColumn.CellTemplate>
|
||
|
|
</DataGridTemplateColumn>
|
||
|
|
|
||
|
|
<DataGridTextColumn
|
||
|
|
Width="140"
|
||
|
|
x:DataType="vm:ProcessViewModel"
|
||
|
|
Binding="{Binding Name}"
|
||
|
|
Header="{i18n:Localize ProcessManagement.DataGrid.Name}" />
|
||
|
|
<DataGridTextColumn
|
||
|
|
Width="140"
|
||
|
|
x:DataType="vm:ProcessViewModel"
|
||
|
|
Binding="{Binding Json}"
|
||
|
|
Header="{i18n:Localize ProcessManagement.DataGrid.Json}" />
|
||
|
|
<DataGridTextColumn
|
||
|
|
Width="180"
|
||
|
|
x:DataType="vm:ProcessViewModel"
|
||
|
|
Binding="{Binding CreateTime}"
|
||
|
|
Header="{i18n:Localize ProcessManagement.DataGrid.CreateTime}"
|
||
|
|
IsReadOnly="True" />
|
||
|
|
<DataGridTextColumn
|
||
|
|
Width="*"
|
||
|
|
x:DataType="vm:ProcessViewModel"
|
||
|
|
Binding="{Binding UpdateTime}"
|
||
|
|
Header="{i18n:Localize ProcessManagement.DataGrid.UpdateTime}"
|
||
|
|
IsReadOnly="True" />
|
||
|
|
|
||
|
|
</DataGrid.Columns>
|
||
|
|
</DataGrid>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<u:Pagination
|
||
|
|
Name="page"
|
||
|
|
Grid.Row="2"
|
||
|
|
Command="{Binding RefreshCommand}"
|
||
|
|
CommandParameter="{Binding $self.CurrentPage}"
|
||
|
|
CurrentPage="{Binding PageIndex, Mode=TwoWay}"
|
||
|
|
PageSize="{Binding PageSize, Mode=TwoWay}"
|
||
|
|
PageSizeOptions="10, 20, 50, 100"
|
||
|
|
ShowPageSizeSelector="True"
|
||
|
|
ShowQuickJump="True"
|
||
|
|
TotalCount="{Binding Totals}" />
|
||
|
|
</Grid>
|
||
|
|
</UserControl>
|