Example #1
0
    public static void Mask(Window owner, object content, System.Action action)
    {
        if (_maskwin != null)
        {
            Unmask();
        }

        if (content == null)
        {
            content = new Viewbox
            {
                Width   = 400,
                Height  = 200,
                Stretch = Stretch.Uniform,
                Child   = new Border()
                {
                    Background = Brushes.White,
                    Child      = new TextBlock()
                    {
                        VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center,
                        Text = "Processing, please wait ...", Foreground = Brushes.DodgerBlue, FontSize = 18
                    }
                }
            };
        }
        _maskwin = (MaskWin)MaskWin.Mask(owner, content, action);
    }
Example #2
0
    public static void Unmask()
    {
        if (_maskwin == null)
        {
            return;
        }

        MaskWin.Unmask(_maskwin);
        _maskwin = null;
    }
Example #3
0
        public static object Mask(Window owner, object content, System.Action action)
        {
            var win = new MaskWin();

            if (owner != null)
            {
                win.Owner = owner;
            }

            win.cancel  = true;
            win.Content = content;
            if (action != null)
            {
                win.Loaded += (aa, bb) => action();
            }
            win.Show();
            return(win);
        }