示例#1
0
        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);
        }
示例#2
0
        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();
                };
            }
        }
示例#4
0
 public static HorizontalAlignment GetButtonPanelHorizontalAlignment(WindowX windowX)
 {
     return((HorizontalAlignment)windowX.GetValue(ButtonPanelHorizontalAlignmentProperty));
 }
示例#5
0
 public static Thickness GetButtonPanelMargin(WindowX windowX)
 {
     return((Thickness)windowX.GetValue(ButtonPanelMarginProperty));
 }
示例#6
0
 public static bool GetInverseButtonsSequence(WindowX windowX)
 {
     return((bool)windowX.GetValue(InverseButtonsSequenceProperty));
 }
示例#7
0
 public static DefaultButton GetDefaultButton(WindowX windowX)
 {
     return((DefaultButton)windowX.GetValue(DefaultButtonProperty));
 }
示例#8
0
 public static Style GetButtonStyle(WindowX windowX)
 {
     return((Style)windowX.GetValue(ButtonStyleProperty));
 }
示例#9
0
 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));
 }
示例#16
0
 public static void SetButtons(WindowX windowX, MessageBoxButton?value)
 {
     windowX.SetValue(ButtonsProperty, value);
 }
示例#17
0
 public static Button GetCancelButton(WindowX windowX)
 {
     return(windowX.ModalCancelButton);
 }
 public static Brush GetBorderBrush(WindowX windowX)
 {
     return((Brush)windowX.GetValue(BorderBrushProperty));
 }
示例#19
0
 public static Button GetNoButton(WindowX windowX)
 {
     return(windowX.ModalNoButton);
 }
 public static void SetBorderBrush(WindowX windowX, Brush value)
 {
     windowX.SetValue(BorderBrushProperty, value);
 }
示例#21
0
 public static void SetButtonStyle(WindowX windowX, Style value)
 {
     windowX.SetValue(ButtonStyleProperty, value);
 }
 public static Thickness GetBorderThickness(WindowX windowX)
 {
     return((Thickness)windowX.GetValue(BorderThicknessProperty));
 }
示例#23
0
 public static void SetDefaultButton(WindowX windowX, DefaultButton value)
 {
     windowX.SetValue(DefaultButtonProperty, value);
 }
 public static void SetBorderThickness(WindowX windowX, Thickness value)
 {
     windowX.SetValue(BorderThicknessProperty, value);
 }
示例#25
0
 public static void SetInverseButtonsSequence(WindowX windowX, bool value)
 {
     windowX.SetValue(InverseButtonsSequenceProperty, value);
 }
示例#26
0
 public static MessageBoxButton?GetButtons(WindowX windowX)
 {
     return((MessageBoxButton?)windowX.GetValue(ButtonsProperty));
 }
示例#27
0
 public static void SetButtonPanelMargin(WindowX windowX, Thickness value)
 {
     windowX.SetValue(ButtonPanelMarginProperty, value);
 }
示例#28
0
 public static object GetCancelButtonContent(WindowX windowX)
 {
     return((object)windowX.GetValue(CancelButtonContentProperty));
 }
示例#29
0
 public static void SetButtonPanelHorizontalAlignment(WindowX windowX, HorizontalAlignment value)
 {
     windowX.SetValue(ButtonPanelHorizontalAlignmentProperty, value);
 }
示例#30
0
 public static void SetCancelButtonContent(WindowX windowX, object value)
 {
     windowX.SetValue(CancelButtonContentProperty, value);
 }