Exemple #1
0
 private void MetroContentControlIsVisibleChanged(MetroContentControl sender, AvaloniaPropertyChangedEventArgs e)
 {
     if (TransitionsEnabled && !transitionLoaded)
     {
         if (!IsVisible)
         {
             MetroContentControlState = ReverseTransition ? MetroContentControlState.AfterUnLoadedReverse : MetroContentControlState.AfterUnLoaded;
             //   VisualStateManager.GoToState(this, ReverseTransition ? "AfterUnLoadedReverse" : "AfterUnLoaded", false);
         }
         else
         {
             MetroContentControlState = ReverseTransition ? MetroContentControlState.AfterLoadedReverse : MetroContentControlState.AfterUnLoaded;
             //   VisualStateManager.GoToState(this, ReverseTransition ? "AfterLoadedReverse" : "AfterLoaded", true);
         }
     }
 }
Exemple #2
0
        private void MetroContentControlStateChanged(MetroContentControl o, AvaloniaPropertyChangedEventArgs e)
        {
            if (e.NewValue is MetroContentControlState)
            {
                MetroContentControlState state = (MetroContentControlState)e.NewValue;
                switch (state)
                {
                case MetroContentControlState.BeforeLoaded:
                    break;

                case MetroContentControlState.AfterUnLoadedReverse:
                    break;

                case MetroContentControlState.AfterUnLoaded:
                    break;

                case MetroContentControlState.AfterLoadedReverse:
                case MetroContentControlState.AfterLoaded:
                    AfterLoadedStoryboardCompleted(this, EventArgs.Empty);
                    break;
                }
            }
        }