Tosker

WPFDialog Part 2 - YesNoView

Jul 26th, 2018
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.42 KB | None | 0 0
  1. <UserControl x:Class="WpfDialogApp.Dialogs.YesNo.YesNoDialogView"
  2.             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5.             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6.             xmlns:local="clr-namespace:WpfDialogApp.Dialogs.YesNo"
  7.             mc:Ignorable="d"
  8.             Height="100" Width="300">
  9.     <Grid>
  10.         <Grid.RowDefinitions>
  11.             <RowDefinition />
  12.             <RowDefinition />
  13.         </Grid.RowDefinitions>
  14.  
  15.         <TextBlock Text="{Binding Message}" Grid.Row="0" HorizontalAlignment="Center" FontSize="16" />
  16.  
  17.         <Grid Grid.Row="1">
  18.             <Grid.ColumnDefinitions>
  19.                 <ColumnDefinition />
  20.                 <ColumnDefinition />
  21.             </Grid.ColumnDefinitions>
  22.  
  23.             <Button Content="Yes" Command="{Binding YesCommand}" Grid.Column="0" Margin="2"
  24.                CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
  25.                AncestorType=Window}}" />
  26.             <Button Content="No" Command="{Binding NoCommand}" Grid.Column="1" Margin="2"
  27.                CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
  28.                AncestorType=Window}}" />
  29.         </Grid>
  30.     </Grid>
  31. </UserControl>
Add Comment
Please, Sign In to add comment