private void UpdateCornerRadius(ContentViewRoundedCorners content)
        {
            try
            {
                if (content == null)
                {
                    return;
                }

                Layer.CornerRadius = content.CornerRadius;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Example #2
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)
            };
        }