Exemplo n.º 1
0
 /// <summary>
 /// Creates a button to show in the default central location. Returns GUI inteface for the button
 /// </summary>
 public IGUI CreateButton(string buttonText, Action buttonPressAction)
 {
     CenterButton button = new CenterButton(buttonText, buttonPressAction);
     button.IsVisible = false;
     guis.Add(button);
     return button;
 }
Exemplo n.º 2
0
 public void Init()
 {
     center        = new CenterButton(ClientSize.Width / 2 - 25, ClientSize.Height / 2 - 25, true);
     ball          = new TargetBall(10, 10, 20, false);
     score         = new Score();
     timer         = new Timer();
     targetCount   = -1;
     stoppingPoint = true;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a Shim from a button
 /// </summary>
 /// <param name="input">The actual CenterButton</param>
 /// <param name="tappedHandler">The tapped handler for this button</param>
 /// <returns></returns>
 public static CenterButtonShim ButtonToShim(CenterButton input, RadialMenu.CenterButtonTappedHandler tappedHandler)
 {
     return(new CenterButtonShim
     {
         BorderBrush = input.BorderBrush,
         Background = input.Background,
         Content = input.Content,
         FontSize = input.FontSize,
         Top = input.Top,
         Left = input.Left,
         CenterButtonTappedHandler = tappedHandler
     });
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var centerButton = new CenterButton();

            centerButton.TouchUpInside += (s, e) =>
            {
                //TableView.ScrollRectToVisible(new CGRect(0, 0, 1, 1), false);
                ViewModel.StumbleCommand.ExecuteIfCan();
            };


            var stumbleButton = new UIBarButtonItem(centerButton)
            {
                Enabled = false
            };

            stumbleButton.EnableIfExecutable(ViewModel.StumbleCommand.CanExecuteObservable);

            ToolbarItems = new []
            {
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                DislikeButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace)
                {
                    Width = 40
                },
                stumbleButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace)
                {
                    Width = 40
                },
                LikeButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
            };

            ViewModel.StumbleCommand.CanExecuteObservable.Subscribe(x => centerButton.Disabled = !x);
            DislikeButton.EnableIfExecutable(ViewModel.StumbleCommand.CanExecuteObservable);
            LikeButton.EnableIfExecutable(ViewModel.StumbleCommand.CanExecuteObservable);

            ViewModel.DislikeCommand.Subscribe(_ => DisplayResponse(Images.ThumbDownFilled));
            ViewModel.LikeCommand.Subscribe(_ => DisplayResponse(Images.ThumbUpFilled));

            ViewModel.StumbleCommand.ExecuteIfCan();
        }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (AddPinInfo != null)
            {
                AddPinInfo.Dispose();
                AddPinInfo = null;
            }

            if (CenterButton != null)
            {
                CenterButton.Dispose();
                CenterButton = null;
            }

            if (MapView != null)
            {
                MapView.Dispose();
                MapView = null;
            }
        }
 public override void Start()
 {
     base.Start();
     instance = GetComponent <CenterButton>();
     m_render = GetComponent <SpriteRenderer>();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Given a Center Button returns a CenterButtonShim of that button
 /// </summary>
 /// <param name="input">The Actual CenterButton</param>
 /// <returns></returns>
 public static CenterButtonShim ButtonToShim(CenterButton input)
 {
     return(ButtonToShim(input, null));
 }
Exemplo n.º 8
0
 private void Awake()
 {
     Instance = this;
     animator = GetComponent <Animator>();
 }