示例#1
0
        private void NavButton_Clicked(SpriteButton sender)
        {
            var navigateTo          = DynamicViewHost.GetNavigateTo(sender);
            var navigationDirection = DynamicViewHost.GetNavigationDirection(sender);

            GetView(navigateTo).SetAsCurrentView(navigationDirection);
        }
示例#2
0
        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;
                }
            }
        }
示例#3
0
        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;
                }
            }
        }
示例#4
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;
         }
     }
 }
示例#5
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();
        }