コード例 #1
0
        public void StartFlyover(UserControl uc)
        {
            // uc needs to implement IFlyoverControl
            var ucfoc = uc as IFlyoutControl;

            if (ucfoc == null)
            {
                return;
            }

            // blur the normal grid
            this.InnerGrid.IsEnabled = false;
            var blur = new BlurEffect();

            blur.Radius            = 5;
            this.InnerGrid.Opacity = 0.5;
            this.InnerGrid.Effect  = blur;

            // populate the flyover grid
            this.GridFlyover.Visibility = Visibility.Visible;
            this.GridFlyover.Children.Clear();
            this.GridFlyover.Children.Add(uc);

            // register the event
            ucfoc.ControlClosed += Ucfoc_ControlClosed;
            currentFlyoutControl = ucfoc;

            // start (focus)
            ucfoc.ControlStart();
        }
コード例 #2
0
        public void StartFlyoverModal(UserControl uc)
        {
            // uc needs to implement IFlyoverControl
            var ucfoc = uc as IFlyoutControl;

            if (ucfoc == null)
            {
                return;
            }

            // blur the normal grid
            this.InnerGrid.IsEnabled = false;
            var blur = new BlurEffect();

            blur.Radius            = 5;
            this.InnerGrid.Opacity = 0.5;
            this.InnerGrid.Effect  = blur;

            // populate the flyover grid
            this.GridFlyover.Visibility = Visibility.Visible;
            this.GridFlyover.Children.Clear();
            this.GridFlyover.Children.Add(uc);

            // register the event
            var frame = new DispatcherFrame();

            ucfoc.ControlClosed += () =>
            {
                Log.Info("Want to end!");
                frame.Continue = false; // stops the frame
            };

            currentFlyoutControl = ucfoc;

            // start (focus)
            ucfoc.ControlStart();

            // This will "block" execution of the current dispatcher frame
            // and run our frame until the dialog is closed.
            Dispatcher.PushFrame(frame);

            // blur the normal grid
            this.InnerGrid.Opacity   = 1.0;
            this.InnerGrid.Effect    = null;
            this.InnerGrid.IsEnabled = true;

            // un-populate the flyover grid
            this.GridFlyover.Children.Clear();
            this.GridFlyover.Visibility = Visibility.Hidden;

            // unregister
            currentFlyoutControl = null;
        }
コード例 #3
0
        public void CloseFlyover()
        {
            // blur the normal grid
            this.InnerGrid.Opacity   = 1.0;
            this.InnerGrid.Effect    = null;
            this.InnerGrid.IsEnabled = true;

            // un-populate the flyover grid
            this.GridFlyover.Children.Clear();
            this.GridFlyover.Visibility = Visibility.Hidden;

            // unregister
            currentFlyoutControl = null;
        }