Resources/ConfirmationDialog.xaml
|
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MinWidth="420" MaxWidth="680" MaxHeight="640" SizeToContent="WidthAndHeight" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" ThemeMode="System" Background="{DynamicResource ApplicationBackgroundBrush}" Foreground="{DynamicResource TextFillColorPrimaryBrush}"> <Window.Resources> <Style x:Key="ConfirmationCardStyle" TargetType="{x:Type Border}"> <Setter Property="Background" Value="{DynamicResource CardBackgroundFillColorDefaultBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="CornerRadius" Value="8" /> <Style.Triggers> <DataTrigger Binding="{Binding Path=(SystemParameters.HighContrast)}" Value="True"> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" /> <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" /> </DataTrigger> </Style.Triggers> </Style> <Style x:Key="ConfirmationFooterStyle" TargetType="{x:Type Border}"> <Setter Property="Background" Value="{DynamicResource LayerFillColorDefaultBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" /> <Setter Property="BorderThickness" Value="0,1,0,0" /> <Style.Triggers> <DataTrigger Binding="{Binding Path=(SystemParameters.HighContrast)}" Value="True"> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" /> <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" /> </DataTrigger> </Style.Triggers> </Style> <Style x:Key="CriticalButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> <Setter Property="Height" Value="32" /> <Setter Property="Padding" Value="12,4" /> <Setter Property="Background" Value="{DynamicResource SystemFillColorCriticalBrush}" /> <Setter Property="Foreground" Value="{DynamicResource TextFillColorInverseBrush}" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border x:Name="ButtonBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4"> <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.90" /> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.75" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Opacity" Value="0.5" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <ScrollViewer x:Name="ConfirmationDetailsScrollViewer" Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Focusable="True" AutomationProperties.Name="Confirmation details"> <StackPanel Margin="24,20,24,20"> <TextBlock x:Name="ConfirmationHeadingText" FontSize="20" FontWeight="SemiBold" TextWrapping="Wrap" /> <Border Style="{StaticResource ConfirmationCardStyle}" Margin="0,16,0,0" Padding="12,8"> <TextBlock x:Name="ConfirmationMessageText" TextWrapping="Wrap" /> </Border> </StackPanel> </ScrollViewer> <Border Grid.Row="1" Style="{StaticResource ConfirmationFooterStyle}" Padding="24,16"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <Button x:Name="ConfirmationCancelButton" Content="Cancel" Visibility="Collapsed" MinWidth="104" Padding="12,4" Margin="0,0,8,0" /> <Button x:Name="ConfirmationNoButton" Content="No" IsCancel="True" MinWidth="104" Padding="12,4" Margin="0,0,8,0" /> <Button x:Name="ConfirmationYesButton" Content="Yes" MinWidth="104" Padding="12,4" /> </StackPanel> </Border> </Grid> </Window> |