Наследование: IVisualStateChangedEventArgs
Пример #1
0
 private void AdaptiveStates_CurrentStateChanged(object sender , VisualStateChangedEventArgs e)
 {
     if (e.NewState == NarrowState && e.NewState != lastState && detailView.ItemsSource != null)
     {
         SetColumnWidthOfDetailView();
         lastState = e.NewState;
     }
 }
 private void AdaptiveStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     if (e.NewState == LargeState && Frame.CanGoBack)
     {
         clearItemOnExit = false;
         Frame.GoBack();
     }
 }
Пример #3
0
 private void WindowStatesOnCurrentStateChanged(object sender,
     VisualStateChangedEventArgs visualStateChangedEventArgs)
 {
     if (WindowStates.CurrentState == WideState)
     {
         Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated += OnAcceleratorKeyActivated;
     }
     else
     {
         Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated -= OnAcceleratorKeyActivated;
     }
 }
 private static void LoadState(VisualStateChangedEventArgs e)
 {
     foreach (var sbase in e.NewState.Setters)
     {
         var setter = sbase as Setter;
         var spath = setter.Target.Path.Path;
         var element = setter.Target.Target as FrameworkElement;
         if (spath.Contains(nameof(RelativeSize)))
         {
             string property = spath.Split('.').Last().TrimEnd(')');
             var prop = typeof(RelativeSize).GetMethod($"Set{property}");
             prop.Invoke(null, new object[] { element, setter.Value });
         }
     }
 }
Пример #5
0
 private void AdaptiveApp_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     VisualState state = (VisualState)e.NewState;
     if (state.Name == "Phone")
     {
         if (selected)
         {
             FirstColumn.Width = new GridLength(0);
             SecondColumn.Width = new GridLength(1, GridUnitType.Star);
         }
         else
         {
             FirstColumn.Width = new GridLength(1, GridUnitType.Star);
             SecondColumn.Width = new GridLength(0);
         }
     }
 }
        private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
        {
            bool isNarrow = e.NewState == NarrowState;
            if (isNarrow)
            {
                Frame.Navigate(typeof(DetailsPage), selectedContact, new SuppressNavigationTransitionInfo());
            }
            else
            {
                VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
                MasterListView.SelectionMode = ListViewSelectionMode.Extended;
                MasterListView.SelectedItem = selectedContact;
            }

            EntranceNavigationTransitionInfo.SetIsTargetElement(MasterListView, isNarrow);
            if (DetailContentPresenter != null)
            {
                EntranceNavigationTransitionInfo.SetIsTargetElement(DetailContentPresenter, !isNarrow);
            }
        }
Пример #7
0
 private void AdaptiveStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     Debug.WriteLine("state changed");
 }
Пример #8
0
 private void SelectionStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     RefreshControlStates();
 }
Пример #9
0
 private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     UpdateVisualState(e.NewState);
 }
Пример #10
0
 private void PageTitleMenuIconsToggleVisualGroup_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     ;
 }
Пример #11
0
 void ApplicationViewStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     _currentVisualState = e.NewState;
 }
Пример #12
0
        /// <summary>
        /// Provides handling for the ExpansionStates CurrentChanged event.
        /// </summary>
        /// <param name="sender">The ExpansionState VisualStateGroup.</param>
        /// <param name="e">Event arguments.</param>
        private void OnExpansionStateGroupStateChanged(object sender, VisualStateChangedEventArgs e)
        {
            // Only listen for the Expanded state
            if (string.Compare(e.NewState.Name, VisualStates.StateExpanded, StringComparison.OrdinalIgnoreCase) != 0)
            {
                return;
            }

            BringIntoView();
        }
Пример #13
0
 private void ArrivalBoxVisualStates_CurrentStateChanging(object sender, VisualStateChangedEventArgs e)
 {
     DoubleAnimation ani = new DoubleAnimation() { To = e.NewState.Name == "ArrivalBoxShown" ? 1 : 0, Duration = TimeSpan.FromSeconds(0.15) };
     Storyboard sb = new Storyboard();
     Storyboard.SetTarget(ani, StopArrivalBox);
     Storyboard.SetTargetProperty(ani, "Opacity");
     sb.Children.Add(ani);
     if (e.NewState.Name == "ArrivalBoxShown")
         StopArrivalBox.Visibility = Visibility.Visible;
     else
         ani.Completed += (s, ev) => StopArrivalBox.Visibility = Visibility.Collapsed;
     sb.Begin();
 }
 void ApplicationViewStates_CurrentStateChanging(object sender, VisualStateChangedEventArgs e)
 {
     SetAppBarState(e.NewState.Name);
 }
Пример #15
0
 private void SizeModesOnCurrentStateChanged(object sender, VisualStateChangedEventArgs visualStateChangedEventArgs)
 {
     UpdateSizeStates();
 }
 private void ToastOnClosed(object sender, VisualStateChangedEventArgs visualStateChangedEventArgs)
 {
     Toast2.Closed -= ToastOnClosed;
     ToastEventBtn.Content = "toast event";
     ToastEventBtn.IsEnabled = true;
 }
 private void OnAdaptiveStatesCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     PublishNarrowMessage(e.NewState);
 }
Пример #18
0
 private void AdaptiveStates_CurrentStateChanged(object sender, Windows.UI.Xaml.VisualStateChangedEventArgs e)
 {
     UpdateForVisualState(e.NewState, e.OldState);
 }
Пример #19
0
 private void VisualStateGroup_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     if (e.NewState == InfoBoxCollapsedState)
         InfoBoxRowDef.Height = CollapsedHeight;
 }
Пример #20
0
 private void WindowSizeVisualStates_CurrentStateChanging(object sender, VisualStateChangedEventArgs e)
 {
     WindowStateChanging();
 }
Пример #21
0
 private void ArrivalBoxVisualStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     CanGoBack = (e.NewState.Name == "ArrivalBoxShown");
 }
		private void vgroup_CurrentStateChanging(object sender, VisualStateChangedEventArgs e)
		{
			if (e.NewState.Name == "CompressionBottom")
			{
				OnLoadMore();
			}
		}
Пример #23
0
 private void VisualStateGroup_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     SetNumberOfColumnsByState(e.NewState);
 }
Пример #24
0
 private void AdaptiveStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
    
 }
Пример #25
0
 /// <summary>
 /// Changes the DataPoint object's state after one of the VSM state animations completes.
 /// </summary>
 /// <param name="sender">Event source.</param>
 /// <param name="e">Event arguments.</param>
 private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     switch (e.NewState.Name)
     {
         case StateRevealShown:
             if (State == (int)DataPointState.Showing)
             {
                 State = (int)DataPointState.Normal;
             }
             break;
         case StateRevealHidden:
             if (State == (int)DataPointState.Hiding)
             {
                 State = (int)DataPointState.Hidden;
             }
             break;
     }
 }
 private void WindowSizeStates_OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     LoadState(e);
 }
Пример #27
0
 private void OnCurrentStateChanging(object sender, VisualStateChangedEventArgs e)
 {
     if (e.NewState.Name.EndsWith("Closed"))
         if (Closing != null)
             Closing(this, e);
 }
Пример #28
0
 private void NavButton_VisualStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     var button = new InfoElement(e.Control);
     switch (e.NewState.Name)
     {
         case "Normal":
         case "PointerOver":
         case "Pressed":
         case "Disabled":
         case "Checked":
         case "CheckedPointerOver":
         case "CheckedPressed":
         case "CheckedDisabled":
         case "Indeterminate":
         case "IndeterminatePointerOver":
         case "IndeterminatePressed":
         case "IndeterminateDisabled":
         default:
             break;
     }
 }
 private void VisualStateGroup_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     getCurrentStateSetup(VisualStateGroup.CurrentState.Name);
 }
Пример #30
0
        private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
        {
            ViewStateChanged?.Invoke(this, EventArgs.Empty);

            switch (CurrentState)
            {
                case MasterDetailState.Narrow:

                    if (DetailFrame.CurrentSourcePageType != BlankPageType)
                    {
                        DetailPresenter.Visibility = Visibility.Visible;
                        IsMasterHidden = true;
                        MasterPresenter.Visibility = Visibility.Collapsed;
                        _extendSplitView.IsOpenBottomPane = false;
                    }
                    else
                    {
                        DetailPresenter.Visibility = Visibility.Collapsed;
                        IsMasterHidden = false;
                        MasterPresenter.Visibility = Visibility.Visible;
                        _extendSplitView.IsOpenBottomPane = true;
                    }
                    break;
                case MasterDetailState.Filled:
                    IsMasterHidden = false;
                    MasterPresenterVisibility(true);
                    DetailPresenterVisibility(true);
                    SetAnimation();
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            SetBackButtonVisibility();
        }
 private void AdaptiveStates_CurrentStateChanged(object sender, VisualStateChangedEventArgs e)
 {
     UpdateForVisualState(e.NewState, e.OldState);
 }
Пример #32
0
        private void OnVisualStateChanged(object sender, Windows.UI.Xaml.VisualStateChangedEventArgs e)
        {
            var mode = NavCategoryStates.Deserialize(Model.CurrentCategory.GetModelCategoryId());

            TraceLogger.GetInstance().LogVisualStateChanged(mode, e.NewState.Name, false);
        }