2025-08-15 15:38:37 +08:00

70 lines
2.7 KiB
XML

<UserControl
x:Class="SWS.WPF.Views.DialogInput"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:SWS.WPF.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary Source="pack://application:,,,/SWS.WPF;component/Style/CustomStyles.xaml" />
</UserControl.Resources>
<prism:Dialog.WindowStyle>
<Style TargetType="Window">
<!-- 关键:设置窗口根据内容自动调整尺寸 -->
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowState" Value="Normal" />
<Setter Property="WindowStyle" Value="None" />
<Setter Property="ResizeMode" Value="NoResize" />
</Style>
</prism:Dialog.WindowStyle>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="35" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<CustomControl:customWindowTitleBar />
<Label
Grid.Row="1"
Width="auto"
Height="auto"
Margin="10,0,0,0"
VerticalAlignment="Bottom"
Content="{Binding TextRemark}" />
<TextBox
Grid.Row="2"
Style="{StaticResource sysTextAreaInfo}"
Text="{Binding TextInfo, Mode=TwoWay}" />
<Border
Grid.Row="3"
Height="30"
Background="{StaticResource ColorPrimary}">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<telerik:RadButton
Margin="5"
Command="{Binding OKCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="提交"
Style="{StaticResource sysBtn}" />
<telerik:RadButton
Margin="5"
Command="{Binding CloseCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="取消"
Style="{StaticResource sysBtn2}" />
</StackPanel>
</Border>
</Grid>
</UserControl>