static NavigationViewItemBase() { IsExpandedProperty.Changed.AddClassHandler <NavigationViewItemBase>( (x, e) => { if (x.IsExpanded == true) { var o_e = new RoutedEventArgs(OpenedEvent); x.RaiseEvent(o_e); } else if (x.IsExpanded == false) { var c_e = new RoutedEventArgs(ClosedEvent); x.RaiseEvent(c_e); } }); OpenedEvent.AddClassHandler <NavigationViewItemBase>((x, e) => x.OnOpened(x, e)); ClosedEvent.AddClassHandler <NavigationViewItemBase>((x, e) => x.OnClosed(x, e)); IsSelectedProperty.Changed.AddClassHandler <NavigationViewItemBase> ((x, e) => { if (x.IsSelected) { x.OnSelected(x, e); } else if (!x.IsSelected) { x.OnDeselected(x, e); } }); IsOpenProperty.Changed.Subscribe(e => OnIsOpenChanged(e)); }
private IEnumerator OpenAsync() { if (_tweens.Count > 0) { foreach (var tween in _tweens) { if (tween != null && tween.isActiveAndEnabled && tween.StartAction != TweenStartAction.DoNothing) { tween.Open(); } } foreach (var tween in _tweens) { if (tween != null && tween.isActiveAndEnabled) { while (tween.IsTweening) { yield return(null); } } } } _state = FormState.Opened; _processRoutine = null; OnOpened(); if (OpenedEvent != null) { OpenedEvent.Invoke(); } }
protected void OpenedEventInvoke() { _state = UITweenState.Opened; if (OpenedEvent != null) { OpenedEvent.Invoke(this); } }
remove => RemoveHandler(OpenedEvent, value);
add => AddHandler(OpenedEvent, value);
/// <summary> /// Once the window is done opening, enable input /// </summary> /// <param name="e"></param> void OnOpenedEvent(OpenedEvent e) { this.SelectFirstLink(); }
internal void Opened() { GameManager.OpenedPack(generation, cardInThisPack); OpenedEvent?.Invoke(generation); }