Example #1
0
        public TopBar()
        {
            _lBtn = new MyButton
            {
                Text = "<",
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions = LayoutOptions.FillAndExpand,
                IsVisible = false,
                IsEnabled = false
            };

            _rBtn = new MyButton
            {
                Text = ">",
                HorizontalOptions = LayoutOptions.End,
                VerticalOptions = LayoutOptions.FillAndExpand,
                IsVisible = false,
                IsEnabled = false
            };

            var denyAction = new DenyAction<object, EventArgs>(NavigationEvent, 1000);

            _lBtn.Clicked += denyAction.OnEvent;
            _rBtn.Clicked += denyAction.OnEvent;

            Content = new MyStackLayout
            {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.Start,
                Children =
                {
                    _lBtn,
                    new MyBoxView(),
                    _rBtn
                }
            };
            HorizontalOptions = Content.HorizontalOptions;
            VerticalOptions = Content.VerticalOptions;
        }
Example #2
0
        public Page3(string pageName) : base(pageName)
        {
            _TopBar.LAction = async () =>
            {
                await Navigation.PopAsync();
            };

	        _TopBar.RAction = async () =>
	        {
		        await Navigation.PushAsync(new Page4("Page 4"));
	        };

			_btn = new MyButton {
				Text = "Goto page 1"
			};
			_btn.Clicked += new DenyAction<object, EventArgs> (BtnClicked).OnEvent;

			Content = new MyStackLayout {
				Children = {
					_btn
				}
			};
        }