Files
DP44/Common/DTS.Common/Dialogs/ConfirmationWindow.xaml
2026-04-17 14:55:32 -04:00

63 lines
3.5 KiB
XML

<Window x:Class="DTS.Common.Dialogs.ConfirmationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
Title="{Binding Title}" Icon="..\Images\question_48.png" WindowStyle="ToolWindow" ResizeMode="NoResize"
SizeToContent="WidthAndHeight" MinWidth="300" MaxWidth="500" MinHeight="150" MaxHeight="500"
x:Name="confirmationWindow">
<Window.Resources>
<Style x:Key="ReadOnlyTextBox" TargetType="TextBox">
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Height" Value="Auto"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
</Style>
</Window.Resources>
<Grid x:Name="LayoutRoot" Margin="2">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Grid.Row="0" Grid.Column="0" Source="..\Images\question_48.png" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,5,0,5"/>
<ContentControl Grid.Row="0" Grid.Column="1" ContentTemplate="{Binding ConfirmationTemplate, ElementName=confirmationWindow}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,10,10,5">
<TextBox Text="{Binding Content}" Style="{StaticResource ReadOnlyTextBox}"/>
</ContentControl>
<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,5,10,5">
<Button x:Name="OKButton" Content="OK" Width="70" Height="25" Cursor="Hand" HorizontalAlignment="Right" Margin="5,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:ChangePropertyAction PropertyName="Confirmed" TargetObject="{Binding}" Value="True"/>
<i:CallMethodAction TargetObject="{Binding ElementName=confirmationWindow}" MethodName="Close"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button x:Name="CancelButton" Content="Cancel" Width="70" Height="25" Cursor="Hand" HorizontalAlignment="Right">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:CallMethodAction TargetObject="{Binding ElementName=confirmationWindow}" MethodName="Close"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
</Window>