Ejemplo n.º 1
0
        public DistributedStackLayoutRenderer(
            DistributedStackLayout layout)
            : base(layout)
        {
            this._layout = new NativeDistributedStackLayout();

            // NOTE: Currently only horizontal orientation is supported

            this.SetNativeElement(this._layout);
        }
Ejemplo n.º 2
0
        public TabBar()
        {
            this._buttonsLayout = new DistributedStackLayout()
            {
                HorizontalAlignment = LayoutAlignment.Fill,
                VerticalAlignment   = LayoutAlignment.Center,
                MaximumSize         = new Size(600, Dimension.Auto),
            };

            this.HorizontalAlignment = LayoutAlignment.Fill;
            this.VerticalAlignment   = LayoutAlignment.Start;

            this.Content = this._buttonsLayout;
        }
Ejemplo n.º 3
0
        public DaysOfWeekPicker()
        {
            this._buttonsLayout = new DistributedStackLayout()
            {
                HorizontalAlignment = LayoutAlignment.Fill,
                VerticalAlignment   = LayoutAlignment.Fill,
                MaximumSize         = new Size(320, Dimension.Auto),
            };

            this.Size = new Size(Dimension.Auto, 40);

            this._buttons[(int)DayOfWeek.Monday]    = AddButton("M");
            this._buttons[(int)DayOfWeek.Tuesday]   = AddButton("T");
            this._buttons[(int)DayOfWeek.Wednesday] = AddButton("W");
            this._buttons[(int)DayOfWeek.Thursday]  = AddButton("T");
            this._buttons[(int)DayOfWeek.Friday]    = AddButton("F");
            this._buttons[(int)DayOfWeek.Saturday]  = AddButton("S");
            this._buttons[(int)DayOfWeek.Sunday]    = AddButton("S");

            this.Content = this._buttonsLayout;
        }
Ejemplo n.º 4
0
 public IDistributedStackLayoutRenderer CreateDistributedStackLayoutRenderer(
     DistributedStackLayout distributedStackLayout)
 {
     return(new DistributedStackLayoutRenderer(this._androidApplication.ApplicationContext, distributedStackLayout));
 }
Ejemplo n.º 5
0
 public IDistributedStackLayoutRenderer CreateDistributedStackLayoutRenderer(
     DistributedStackLayout distributedStackLayout)
 {
     return(new DistributedStackLayoutRenderer(distributedStackLayout));
 }
Ejemplo n.º 6
0
        private MessageBox(
            string message,
            string title)
        {
            if (null == message)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (null == title)
            {
                throw new ArgumentNullException(nameof(title));
            }

            this._message = message;
            this._title   = title;
            this._result  = MessageBoxResult.Cancel;

            var contentLayout = new DockLayout()
            {
                MaximumSize = new Size(300f, Dimension.Auto),
            };

            this._messageView = new TextView()
            {
                Text                = this._message,
                ForegroundColor     = Colors.White,
                FontSize            = 14f,
                WordWrap            = true,
                HorizontalAlignment = LayoutAlignment.Fill,
                VerticalAlignment   = LayoutAlignment.Fill,
                Margin              = new Thickness(20),
            };
            contentLayout.Children.Add(this._messageView, DockRegion.Top);

            var buttonsLayout = new DistributedStackLayout()
            {
                HorizontalAlignment = LayoutAlignment.Fill,
                VerticalAlignment   = LayoutAlignment.End,
            };

            contentLayout.Children.Add(buttonsLayout, DockRegion.Top);

            var cancelButton = new Button()
            {
                Text                = "Cancel",
                IsAlertStyle        = true,
                Size                = new Size(100, 30),
                Margin              = new Thickness(5),
                HorizontalAlignment = LayoutAlignment.Center,
            };

            cancelButton.Clicked += CancelButton_Clicked;
            buttonsLayout.Children.Add(cancelButton);

            var okButton = new Button()
            {
                Text                = "Ok",
                IsAlertStyle        = true,
                Size                = new Size(100, 30),
                Margin              = new Thickness(5),
                HorizontalAlignment = LayoutAlignment.Center,
            };

            okButton.Clicked += OkButton_Clicked;
            buttonsLayout.Children.Add(okButton);

            this.Content = contentLayout;

            this.OnApplyTheme(this.Application.Theme); // HACK
        }
Ejemplo n.º 7
0
        public DistributedStackLayoutPage()
        {
            var stackLayout = new DistributedStackLayout()
            {
            };

            stackLayout.Children.Add(
                new TextView()
            {
                HorizontalAlignment = LayoutAlignment.Center,
                Text            = "ITEM1",
                ForegroundColor = Colors.White,
                BackgroundColor = Colors.Red,
            });

            stackLayout.Children.Add(
                new Image()
            {
                Source = ThemeResources.Default.AboutLogo,
                Size   = new Size(50),
                HorizontalAlignment = LayoutAlignment.Center,
            });

            stackLayout.Children.Add(
                new TextView()
            {
                HorizontalAlignment = LayoutAlignment.Center,
                Text            = "ITEM2",
                ForegroundColor = Colors.White,
                BackgroundColor = Colors.Red,
            });

            var distributedStackLayout = new DistributedStackLayout()
            {
                HorizontalAlignment = LayoutAlignment.Fill,
            };

            distributedStackLayout.Children.Add(
                new TextView()
            {
                HorizontalAlignment = LayoutAlignment.Center,
                Text            = "ITEM1",
                ForegroundColor = Colors.White,
                BackgroundColor = Colors.Red,
            });

            distributedStackLayout.Children.Add(
                new Image()
            {
                Source = ThemeResources.Default.AboutLogo,
                Size   = new Size(50),
                HorizontalAlignment = LayoutAlignment.Center,
            });

            distributedStackLayout.Children.Add(
                new TextView()
            {
                HorizontalAlignment = LayoutAlignment.Center,
                Text            = "ITEM2",
                ForegroundColor = Colors.White,
                BackgroundColor = Colors.Red,
            });

            var pageLayout = new DockLayout()
            {
            };

            pageLayout.Children.Add(stackLayout, DockRegion.Top);
            pageLayout.Children.Add(distributedStackLayout, DockRegion.Top);

            this.Layout = pageLayout;
        }