misc
This commit is contained in:
@@ -122,39 +122,67 @@
|
||||
<Border x:Name="stackButtons" Grid.Row="3" Padding="10"
|
||||
Background="{Binding Path=ButtonBackground}" >
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" >
|
||||
<Button x:Name="btnOK" Content=" OK " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnOK"
|
||||
Content=" OK "
|
||||
MinWidth="75"
|
||||
Margin="5,0,5,0"
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
Height="25"
|
||||
MinHeight="25"
|
||||
Visibility="{Binding Path=ShowOk}"
|
||||
IsDefault="{Binding Path=IsDefaultOK}"
|
||||
Click="BtnOK_Click" />
|
||||
<Button x:Name="btnYes" Content=" Yes " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnYes"
|
||||
Content=" Yes "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowYes}"
|
||||
IsDefault="{Binding Path=IsDefaultYes}"
|
||||
Click="BtnYes_Click"/>
|
||||
<Button x:Name="btnNo" Content=" No " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnNo"
|
||||
Content=" No "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowNo}"
|
||||
IsDefault="{Binding Path=IsDefaultNo}"
|
||||
Click="BtnNo_Click"/>
|
||||
<Button x:Name="btnAbort" Content=" Abort " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnAbort"
|
||||
Content=" Abort "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowAbort}"
|
||||
IsDefault="{Binding Path=IsDefaultAbort}"
|
||||
Click="BtnAbort_Click"/>
|
||||
<Button x:Name="btnRetry" Content=" Retry " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnRetry"
|
||||
Content=" Retry "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowRetry}"
|
||||
IsDefault="{Binding Path=IsDefaultRetry}"
|
||||
Click="BtnRetry_Click"/>
|
||||
<Button x:Name="btnIgnore" Content=" Ignore " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnIgnore"
|
||||
Content=" Ignore "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowIgnore}"
|
||||
IsDefault="{Binding Path=IsDefaultIgnore}"
|
||||
Click="BtnIgnore_Click"/>
|
||||
<Button x:Name="btnCancel" Content=" Cancel " MinWidth="75" Margin="5,0,5,0"
|
||||
<Button x:Name="btnCancel"
|
||||
Content=" Cancel "
|
||||
Width="{Binding Path=ButtonWidth}"
|
||||
MinWidth="75"
|
||||
MinHeight="25"
|
||||
Margin="5,0,5,0"
|
||||
Visibility="{Binding Path=ShowCancel}"
|
||||
IsDefault="{Binding Path=IsDefaultCancel}"
|
||||
Click="BtnCancel_Click"/>
|
||||
|
||||
@@ -96,13 +96,13 @@ public partial class MessageBoxEx : Window, INotifyPropertyChanged
|
||||
|
||||
public static void SetOwner(Window window)
|
||||
{
|
||||
IntPtr ownerHandle = GetOwnerHandle();
|
||||
IntPtr parentHandle = GetParentHandle();
|
||||
|
||||
if (ownerHandle != IntPtr.Zero)
|
||||
new WindowInteropHelper(window).Owner = ownerHandle;
|
||||
if (parentHandle != IntPtr.Zero)
|
||||
new WindowInteropHelper(window).Owner = parentHandle;
|
||||
}
|
||||
|
||||
public static IntPtr GetOwnerHandle()
|
||||
public static IntPtr GetParentHandle()
|
||||
{
|
||||
IntPtr foregroundWindow = GetForegroundWindow();
|
||||
GetWindowThreadProcessId(foregroundWindow, out var procID);
|
||||
|
||||
Reference in New Issue
Block a user