示例#1
0
        public AdminPanelMaster(MainPage _main)
        {
            main = _main;

            Image image = new Image {
                Aspect = Aspect.AspectFit, Margin = 15
            };

            image.SetBinding(Image.SourceProperty, new Binding {
                Path = "ImageLink"
            });

            Label lName = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lName.SetBinding(Label.TextProperty, new Binding {
                Path = "Name", StringFormat = "Имя: {0}",
            });

            Label lSurname = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lSurname.SetBinding(Label.TextProperty, new Binding {
                Path = "Surname", StringFormat = "Фамилия: {0}",
            });

            Label lPatronymic = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lPatronymic.SetBinding(Label.TextProperty, new Binding {
                Path = "Patronymic", StringFormat = "Отчество: {0}",
            });

            Button buttonListMovie = new ButtonPanel {
                Text = "Список фильмов"
            };

            buttonListMovie.Clicked += PageListMoview;
            Button buttonListAccount = new ButtonPanel {
                Text = "Список аккаунтов"
            };

            buttonListAccount.Clicked += PageListAccount;
            Button buttonMenu = new ButtonPanel {
                Text = "Перейти на главное меню"
            };

            buttonMenu.Clicked += PageMenu;

            StackLayout stack = new StackLayout
            {
                Children =
                {
                    new Frame
                    {
                        Content = new StackLayout
                        {
                            Children ={ image,                lName, lSurname, lPatronymic }
                        },
                        BackgroundColor = Color.LightSkyBlue,
                        CornerRadius    = 20,
                        Margin          = 10,
                    },
                    buttonListMovie,
                    buttonListAccount,
                    buttonMenu
                }
            };

            Content = new ScrollView {
                Content = stack
            };
        }
        public UserPanelMaster(MainPage _main)
        {
            main = _main;
            Image image = new Image {
                Aspect = Aspect.AspectFit, Margin = 15
            };

            image.SetBinding(Image.SourceProperty, new Binding {
                Path = "ImageLink"
            });

            Label lName = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lName.SetBinding(Label.TextProperty, new Binding {
                Path = "Name", StringFormat = "Имя: {0}",
            });

            Label lSurname = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lSurname.SetBinding(Label.TextProperty, new Binding {
                Path = "Surname", StringFormat = "Фамилия: {0}",
            });

            Label lPatronymic = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lPatronymic.SetBinding(Label.TextProperty, new Binding {
                Path = "Patronymic", StringFormat = "Отчество: {0}",
            });

            Label lMoney = new Label {
                FontSize = 14, Margin = new Thickness(10, 0)
            };

            lMoney.SetBinding(Label.TextProperty, new Binding {
                Path = "Money", StringFormat = "Денег на счету: {0}",
            });

            Button buttonListMovie = new ButtonPanel {
                Text = "Список фильмов"
            };

            buttonListMovie.Clicked += PageListMovie;
            Button buttonBasket = new ButtonPanel {
                Text = "Корзина"
            };

            buttonBasket.Clicked += PageBasket;
            Button buttonBuyMovie = new ButtonPanel {
                Text = "Купленные фильмы"
            };

            buttonBuyMovie.Clicked += PageBuyMovie;
            Button buttonRefill = new ButtonPanel {
                Text = "Пополнение счета"
            };

            buttonRefill.Clicked += PageRefill;
            Button buttonMenu = new ButtonPanel {
                Text = "Перейти на главное меню"
            };

            buttonMenu.Clicked += PageMenu;


            StackLayout stack = new StackLayout
            {
                Children =
                {
                    new Frame
                    {
                        Content = new StackLayout
                        {
                            Children ={ image,                lName, lSurname, lPatronymic, lMoney }
                        },
                        BackgroundColor = Color.LightSkyBlue,
                        CornerRadius    = 20,
                        Margin          = 10,
                    },
                    buttonListMovie,
                    buttonBasket,
                    buttonBuyMovie,
                    buttonRefill,
                    buttonMenu
                }
            };

            Content = new ScrollView {
                Content = stack
            };
        }