Beispiel #1
0
        public virtual void OPFrameLoaded(object sender, RoutedEventArgs e)
        {
            //if (DesignerProperties.GetIsInDesignMode(new DependencyObject())) return;
            //IsShown = this.Visibility == Visibility.Visible;
            //this.IsVisibleChanged += (s, e2) => { IsShown = this.Visibility == Visibility.Visible; };
            this.CommandBindings.Add(new CommandBinding(OPFrame.CloseCommand, OnCloseMe));
            this.CommandBindings.Add(new CommandBinding(OPFrame.AdditionalButtonClickCommand, OnAdditionalButtonClickMe));
            _ParentWindow = Application.Current.Windows.OfType <Window>().SingleOrDefault(x => x.IsActive);
            if (_ParentWindow == null)
            {
                return;
            }
            //_ParentWindow.KeyDown -= _ParentWindow_KeyDown;
            if (this.EnableEscapeKey)
            {
                _ParentWindow.KeyDown += _ParentWindow_KeyDown;
            }

            StoryboardShow  = (Storyboard)this.FindResource("sbOPFrameShow");
            StoryboardShow  = StoryboardShow.Clone();
            StoryboardClose = (Storyboard)this.FindResource("sbOPFrameClose");
            StoryboardClose = StoryboardClose.Clone();

            Storyboard.SetTarget(StoryboardShow, this);
            Storyboard.SetTarget(StoryboardClose, this);
        }
Beispiel #2
0
 private void BigRoundButton_Tap(object sender, GestureEventArgs e)
 {
     if (!isOpened)
     {
         StoryboardOpen.Begin();
         isOpened = true;
     }
     else
     {
         StoryboardClose.Begin();
         isOpened = false;
     }
 }