private static MessageBoxResult CallMsgBox(Window owner, string message, string title, MessageBoxButton messageBoxButton, MessageBoxXConfigurations configurations) { var msb = new MsgBox(owner, message, title, messageBoxButton, configurations); WindowX windowX = null; if (configurations.InteractOwnerMask && owner != null && owner is WindowX) { windowX = owner as WindowX; } windowX.IsMaskVisible = true; msb.ShowDialog(); windowX.IsMaskVisible = false; return(msb.MessageBoxResult); }
private static IPendingHandler CallPendingBox(Window owner, string message, string title, bool cancelable, PendingBoxConfigurations configurations) { var msb = new Controls.Internal.PendingBox(owner, message, title, cancelable, configurations); var handler = new PendingHandler(() => { msb.ForceClose(); }, (s) => { msb.UpdateMessage(s); }); WindowX windowX = null; if (configurations.InteractOwnerMask && owner != null && owner is WindowX) { windowX = owner as WindowX; } if (windowX != null) { windowX.IsMaskVisible = true; } msb.Closed += (s, e) => { if (windowX != null) { windowX.IsMaskVisible = false; } handler.RaiseCanceledEvent(s, e); }; msb.Canceled += (s, e) => { handler.RaiseCanceledEvent(s, e); }; msb.Show(); return(handler); }
private static void SetCaptionHeight(WindowX windowX, double height) { var action = new Action(() => { var chrome = WindowChrome.GetWindowChrome(windowX); if (chrome == null) { return; } chrome.CaptionHeight = height; }); if (windowX.IsLoaded) { action(); } else { windowX.Loaded += delegate { action(); }; } }
public static HorizontalAlignment GetButtonPanelHorizontalAlignment(WindowX windowX) { return((HorizontalAlignment)windowX.GetValue(ButtonPanelHorizontalAlignmentProperty)); }
public static Thickness GetButtonPanelMargin(WindowX windowX) { return((Thickness)windowX.GetValue(ButtonPanelMarginProperty)); }
public static bool GetInverseButtonsSequence(WindowX windowX) { return((bool)windowX.GetValue(InverseButtonsSequenceProperty)); }
public static DefaultButton GetDefaultButton(WindowX windowX) { return((DefaultButton)windowX.GetValue(DefaultButtonProperty)); }
public static Style GetButtonStyle(WindowX windowX) { return((Style)windowX.GetValue(ButtonStyleProperty)); }
public static Button GetYesButton(WindowX windowX) { return(windowX.ModalYesButton); }
public static void SetBackground(WindowX windowX, Brush value) { windowX.SetValue(BackgroundProperty, value); }
public static Brush GetBackground(WindowX windowX) { return((Brush)windowX.GetValue(BackgroundProperty)); }
public static void SetPadding(WindowX windowX, Thickness value) { windowX.SetValue(PaddingProperty, value); }
public static Thickness GetPadding(WindowX windowX) { return((Thickness)windowX.GetValue(PaddingProperty)); }
public static void SetBackstageMaximizeButtonStyle(WindowX windowX, Style value) { windowX.SetValue(BackstageMaximizeButtonStyleProperty, value); }
public static Style GetBackstageMaximizeButtonStyle(WindowX windowX) { return((Style)windowX.GetValue(BackstageMaximizeButtonStyleProperty)); }
public static void SetButtons(WindowX windowX, MessageBoxButton?value) { windowX.SetValue(ButtonsProperty, value); }
public static Button GetCancelButton(WindowX windowX) { return(windowX.ModalCancelButton); }
public static Brush GetBorderBrush(WindowX windowX) { return((Brush)windowX.GetValue(BorderBrushProperty)); }
public static Button GetNoButton(WindowX windowX) { return(windowX.ModalNoButton); }
public static void SetBorderBrush(WindowX windowX, Brush value) { windowX.SetValue(BorderBrushProperty, value); }
public static void SetButtonStyle(WindowX windowX, Style value) { windowX.SetValue(ButtonStyleProperty, value); }
public static Thickness GetBorderThickness(WindowX windowX) { return((Thickness)windowX.GetValue(BorderThicknessProperty)); }
public static void SetDefaultButton(WindowX windowX, DefaultButton value) { windowX.SetValue(DefaultButtonProperty, value); }
public static void SetBorderThickness(WindowX windowX, Thickness value) { windowX.SetValue(BorderThicknessProperty, value); }
public static void SetInverseButtonsSequence(WindowX windowX, bool value) { windowX.SetValue(InverseButtonsSequenceProperty, value); }
public static MessageBoxButton?GetButtons(WindowX windowX) { return((MessageBoxButton?)windowX.GetValue(ButtonsProperty)); }
public static void SetButtonPanelMargin(WindowX windowX, Thickness value) { windowX.SetValue(ButtonPanelMarginProperty, value); }
public static object GetCancelButtonContent(WindowX windowX) { return((object)windowX.GetValue(CancelButtonContentProperty)); }
public static void SetButtonPanelHorizontalAlignment(WindowX windowX, HorizontalAlignment value) { windowX.SetValue(ButtonPanelHorizontalAlignmentProperty, value); }
public static void SetCancelButtonContent(WindowX windowX, object value) { windowX.SetValue(CancelButtonContentProperty, value); }