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); }
private void BigRoundButton_Tap(object sender, GestureEventArgs e) { if (!isOpened) { StoryboardOpen.Begin(); isOpened = true; } else { StoryboardClose.Begin(); isOpened = false; } }