private void NavButton_Clicked(SpriteButton sender) { var navigateTo = DynamicViewHost.GetNavigateTo(sender); var navigationDirection = DynamicViewHost.GetNavigationDirection(sender); GetView(navigateTo).SetAsCurrentView(navigationDirection); }
private static void OnNoButtonPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is YesNoDV yndv) { if (e.OldValue is SpriteButton onb) { onb.Clicked -= yndv.NavButton_Clicked; } if (e.NewValue is SpriteButton nnb && DynamicViewHost.GetNavigateTo(nnb) is string) { nnb.Clicked += yndv.NavButton_Clicked; } } }
private static void OnOKButtonPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is MessageDV mdv) { if (e.OldValue is SpriteButton oob) { oob.Clicked -= mdv.SpriteButton_Clicked; } if (e.NewValue is SpriteButton nob && DynamicViewHost.GetNavigateTo(nob) is string) { nob.Clicked += mdv.SpriteButton_Clicked; } } }
private void SubscribeButtonsNavigation() { for (int i = 0; i < Buttons?.Count; i++) { if (DynamicViewHost.GetNavigateTo(Buttons[i]) is string ntstr && DynamicViewHost.GetNavigationDirection(Buttons[i]) is DynamicViewHost.NavigationDirections nd) //if (DynamicViewHost.GetNavigateTo(Buttons[i]) is string ntstr && // DynamicViewHost.GetNavigationDirection(Buttons[i]) is DynamicViewHost.NavigationDirections nd) { Buttons[i].Clicked -= MultiButtonDV_Clicked; Buttons[i].Clicked += MultiButtonDV_Clicked; //Buttons[i].Clicked -= MultiButtonDV_Clicked; //Buttons[i].Clicked += MultiButtonDV_Clicked; } } }
private void Buttons_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { for (int i = 0; i < e.OldItems?.Count; i++) { ((SpriteButton)e.OldItems[i]).Clicked -= MultiButtonDV_Clicked; } for (int i = 0; i < e.NewItems?.Count; i++) { if (DynamicViewHost.GetNavigateTo((SpriteButton)e.NewItems[i]) is string ntstr && DynamicViewHost.GetNavigationDirection((SpriteButton)e.NewItems[i]) is DynamicViewHost.NavigationDirections nd) { ((SpriteButton)e.NewItems[i]).Clicked += MultiButtonDV_Clicked; } } SubscribeButtonsNavigation(); }