Files
SzmediTools/Szmedi.RvKits/InfoManager/PropEditor/WriteParametersWin.xaml
2025-09-19 09:18:09 +08:00

108 lines
5.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<controls:MaterialWindow
x:Class="Szmedi.RvKits.InfoManager.WriteParametersWin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:controls="clr-namespace:Szmedi.RvKits.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Szmedi.RvKits.InfoManager"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
Title="实例参数编辑"
Width="500"
Height="400"
d:DataContext="{d:DesignInstance Type=local:WriteParametersViewModel}"
SizeToContent="Height"
mc:Ignorable="d">
<controls:MaterialWindow.Resources>
<ResourceDictionary Source="pack://application:,,,/Szmedi.RvKits;component/WPFUI.xaml" />
</controls:MaterialWindow.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<DataGrid
Grid.Row="0"
Grid.Column="0"
d:ItemsSource="{d:SampleData}"
AutoGenerateColumns="False"
CanUserAddRows="False"
ItemsSource="{Binding Items}">
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Name}"
Header="参数名"
IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Header="参数值" />
</DataGrid.Columns>
</DataGrid>
<StackPanel
Grid.Row="0"
Grid.Column="1"
Margin="5">
<StackPanel
HorizontalAlignment="Center"
Orientation="Horizontal"
ToolTip="选中元素修改,否则全部可见元素(临时隐藏也算不可见)修改参数值">
<TextBlock Text="全部" ToolTip="可见元素全部修改" />
<ToggleButton IsChecked="{Binding IsSelectedItems}" Style="{StaticResource MaterialDesignSwitchToggleButton}" />
<TextBlock Text="仅选中" ToolTip="选中元素修改" />
</StackPanel>
<CheckBox
MinWidth="5"
Margin="5"
HorizontalAlignment="Center"
Content="覆盖现值"
IsChecked="{Binding IsOverride}"
ToolTip="已有的属性值的属性会被左侧表中属性的参数值覆盖" />
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource MaterialDesignToolToggleListBox}">
<b:Interaction.Triggers>
<b:EventTrigger EventName="SelectionChanged">
<b:InvokeCommandAction Command="{Binding InitCommand}" CommandParameter="{Binding SelectedIndex, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}" />
</b:EventTrigger>
</b:Interaction.Triggers>
<ListBoxItem Content="土建" ToolTip="在表中加载默认土建填写参数" />
<ListBoxItem Content="机电" ToolTip="在表中加载默认机电填写参数" />
</ListBox>
<TextBox
md:HintAssist.Hint="Excel路径"
Text="{Binding ExcelPath, UpdateSourceTrigger=PropertyChanged}"
ToolTip="输入路径回车读取文件">
<TextBox.InputBindings>
<KeyBinding Key="Return" Command="{Binding OpenExcelCommand}" />
</TextBox.InputBindings>
<!--<b:Interaction.Triggers>
<b:EventTrigger EventName="LostFocus">
<b:InvokeCommandAction Command="{Binding OpenExcelCommand}" CommandParameter="{Binding Text, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TextBox}}" />
</b:EventTrigger>
</b:Interaction.Triggers>-->
</TextBox>
<!--<TextBox md:HintAssist.Hint="忽略属性" Text="{Binding ExcelPath, UpdateSourceTrigger=PropertyChanged}" ToolTip="输入路径回车读取文件">
<TextBox.InputBindings>
<KeyBinding Key="Return" Command="{Binding OpenExcelCommand}" />
</TextBox.InputBindings>
</TextBox>-->
<Button
Command="{Binding GetParamsCommand}"
Content="从构件提取参数"
ToolTip="通过拾取构件,将属性加载在表格中" />
<Button
Command="{Binding BrowserExcelFileCommand}"
Content="打开Excel文件"
ToolTip="将Excel中的属性-值导入到表中" />
<Button
Command="{Binding ExportExcelCommand}"
Content="导出Excel文件"
ToolTip="将表中的属性-值导出到Excel中可使用打开Excel文件功能进行复用" />
<Button
Command="{Binding WriteParamsCommand}"
Content="填写属性值"
ToolTip="深圳轨道交通标准的属性&#x0a;未填值会默认为“/”或“0”&#x0a;填写属性值前,注意将不需要填写的属性从表中移除,&#x0a;若参数值为空,则会清空值" />
</StackPanel>
</Grid>
</controls:MaterialWindow>