Exemplo n.º 1
0
        private void NavButton_Clicked(SpriteButton sender)
        {
            var navigateTo          = DynamicViewHost.GetNavigateTo(sender);
            var navigationDirection = DynamicViewHost.GetNavigationDirection(sender);

            GetView(navigateTo).SetAsCurrentView(navigationDirection);
        }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 3
0
        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();
        }