コード例 #1
0
ファイル: AppTitle.cs プロジェクト: lazaruk/MyCast
        public AppTitle()
        {
            var content = new Grid();

            content.Children.Add(new Label
            {
                Text              = "ла алал алал алала ала лал",
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            });

            if (App.Current.MainViewModel.ShowMenu)
            {
                var menuButton = new ButtonWithoutStyles
                {
                    Command           = App.Current.MainPage.TogglePresentedCommand,
                    Text              = AwesomeFontIcons.Menu,
                    FontFamily        = AppStyles.FontAwesomeFamily,
                    TextColor         = AppStyles.MenuButtonColor,
                    FontSize          = AppStyles.VeryLargeFontSize,
                    BackgroundColor   = Color.Transparent,
                    HorizontalOptions = LayoutOptions.Start,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    WidthRequest      = 50
                };
                content.Children.Add(menuButton);
            }

            Content = content;

            HeightRequest   = 50;
            BackgroundColor = Color.FromRgb(236, 236, 236);
        }
コード例 #2
0
ファイル: StartPage.cs プロジェクト: lazaruk/MyCast
        private void AddPageContent()
        {
            var buttonLogin = new Button
            {
                Text             = "Войти",
                BackgroundColor  = AppStyles.PrimaryColor,
                TextColor        = Color.White,
                Command          = App.Current.Navigation.ShowPopupCommand,
                CommandParameter = new CreatePopupInfo(typeof(LoginForm))
            };

            var buttonRegister = new ButtonWithoutStyles
            {
                Text             = "Регистрация",
                BackgroundColor  = Color.Transparent,
                TextColor        = AppStyles.PrimaryColor,
                Command          = App.Current.Navigation.ShowPopupCommand,
                CommandParameter = new CreatePopupInfo(typeof(RegisterForm))
            };

            var buttonStack = new StackLayout {
                Children = { buttonLogin, buttonRegister }
            };

            var logo = new Image
            {
                Source            = "logo.png", //todo from bd
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                WidthRequest      = 400 //fix
            };

            var content = new Grid
            {
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition {
                        Height = new GridLength(8, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(2, GridUnitType.Star)
                    }
                }
            };

            content.Children.Add(logo, 0, 0);
            content.Children.Add(buttonStack, 0, 1);

            _scrollView.Content = content;
        }
コード例 #3
0
        public LoginAndRegisterDialog()
        {
            var crossButton = new ButtonWithoutStyles
            {
                FontSize            = 30,
                HorizontalOptions   = LayoutOptions.End,
                MinimumWidthRequest = 55,
                HeightRequest       = 50,
                FontFamily          = AppStyles.FontAwesomeFamily,
                Text            = AwesomeFontIcons.Close,
                TextColor       = AppStyles.PrimaryColor,
                BackgroundColor = Color.Transparent,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Command         = App.Current.Navigation.ClosePopupCommand
            };

            Text = new Label
            {
                FontSize          = 24,
                HorizontalOptions = LayoutOptions.CenterAndExpand
            };

            _circleLayout = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Spacing           = 10
            };

            _contentLayout = new StackLayout
            {
                Margin   = new Thickness(0, 0, 60, 0),
                Children = { Text, _circleLayout, new BoxView {
                                 Style = AppStyles.SeparatorStyle
                             } }
            };

            NextButton = new ButtonWithoutStyles
            {
                Text = "Далее",
                HorizontalOptions = LayoutOptions.End,
                Style             = AppStyles.LoginAndRegisterButtonStyle
            };

            var buttonGrid = new Grid
            {
                ColumnDefinitions = new ColumnDefinitionCollection
                {
                    new ColumnDefinition {
                        Width = GridLength.Star
                    },
                    new ColumnDefinition {
                        Width = GridLength.Star
                    }
                },
                Padding = new Thickness(0, 0, 20, 0)
            };

            buttonGrid.Children.Add(NextButton, 1, 0);

            Content = new ContentViewRoundedCorners
            {
                CornerRadius      = 30,
                BackgroundColor   = Color.White,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = new Thickness(60, 0),
                Content           = new StackLayout {
                    Children = { crossButton, _contentLayout, buttonGrid }
                },
                Padding = new Thickness(60, 10, 0, 30)
            };
        }