Exemplo n.º 1
0
        protected virtual void OnIsPaneOpenChanged()
        {
            bool cancel = false;

            if (PaneClosing != null)
            {
                var args = new SplitViewPaneClosingEventArgs();
                foreach (Windows.Foundation.TypedEventHandler <SplitView, SplitViewPaneClosingEventArgs> tmp in PaneClosing.GetInvocationList())
                {
                    tmp(this, args);
                    if (args.Cancel)
                    {
                        cancel = true;
                        break;
                    }
                }
            }
            if (!cancel)
            {
                OnStateChanged();

                if (PaneClosed != null)
                {
                    PaneClosed(this, new object());
                }
            }
            else
            {
                IsPaneOpen = false;
            }
        }
Exemplo n.º 2
0
 protected virtual void OnIsPaneOpenChanged(bool newValue)
 {
     if (newValue)
     {
         OnVisualStateChanged();
     }
     else
     {
         if (PaneClosing != null)
         {
             SplitViewPaneClosingEventArgs args = new SplitViewPaneClosingEventArgs();
             foreach (TypedEventHandler <SplitView, SplitViewPaneClosingEventArgs> handler in PaneClosing.GetInvocationList())
             {
                 handler(this, args);
                 if (args.Cancel)
                 {
                     IsPaneOpen = true;
                     return;
                 }
             }
         }
         OnVisualStateChanged();
         PaneClosed?.Invoke(this, null);
     }
 }