Files
DMS/DMS.WPF/Views/Dialogs/InputDialog.xaml
David P.G e5e2e8de5b 功能增强:添加 InputDialog 并改进变量管理功能
- 新增 InputDialog 组件:
     - 添加了 InputDialog.xaml 和 InputDialog.xaml.cs 文件
     - 创建了 InputDialogViewModel.cs,继承自 DialogViewModelBase<string?>
     - 实现了可重用的输入对话框,支持自定义标题、消息、标签和占位符

   - 完善变量管理服务:
     - 在 MappingProfile.cs 中添加了 VariableDto 到 VariableDto 的映射配置
     - 在 VariableManagementService.cs 中注入 IMapper 依赖项
     - 修改了 UpdateVariablesAsync 方法,使用 AutoMapper 进行更安全的更新操作

   - 扩展变量表功能:
     - 在 VariableTableViewModel.cs 中添加了 ModifyConversionFormula 命令
     - 实现了批量修改变量转换公式功能,支持用户通过对话框输入新公式
     - 添加了相应的 UI 通知和错误处理
     - 在 VariableTableView.xaml 中添加了"修改数值转换公式"菜单项

   - 集成 InputDialog 到对话框服务:
     - 在 DialogService.cs 中注册了 InputDialogViewModel 和 InputDialog 的映射关系
2025-10-02 18:34:23 +08:00

25 lines
1.2 KiB
XML

<ui:ContentDialog
x:Class="DMS.WPF.Views.Dialogs.InputDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:vm="clr-namespace:DMS.WPF.ViewModels.Dialogs"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance vm:InputDialogViewModel}"
Title="{Binding Title}"
PrimaryButtonText="{Binding PrimaryButtonText}"
CloseButtonText="{Binding CloseButtonText}"
PrimaryButtonCommand="{Binding ConfirmCommand}"
CloseButtonCommand="{Binding CancelCommand}">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Message}" Margin="0,0,0,10" TextWrapping="Wrap"/>
<hc:TextBox Text="{Binding InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
hc:InfoElement.Title="{Binding InputLabel}"
hc:InfoElement.Placeholder="{Binding InputPlaceholder}"/>
</StackPanel>
</Grid>
</ui:ContentDialog>