コード例 #1
0
            public PropertyWheelWidgetBase(HudParentBase parent = null) : base(parent)
            {
                confirmButton = new BorderedButton()
                {
                    Text        = "Confirm",
                    Height      = 40f,
                    Width       = 150f,
                    Padding     = Vector2.Zero,
                    TextPadding = Vector2.Zero,
                };
                cancelButton = new BorderedButton()
                {
                    Text        = "Cancel",
                    Height      = 40f,
                    Width       = 150f,
                    Padding     = Vector2.Zero,
                    TextPadding = Vector2.Zero,
                };

                buttonChain = new HudChain(false)
                {
                    ParentAlignment     = ParentAlignments.Left | ParentAlignments.Inner,
                    Spacing             = 8f,
                    CollectionContainer = { confirmButton, cancelButton }
                };

                DimAlignment = DimAlignments.Width | DimAlignments.IgnorePadding;

                MouseInput = new MouseInputElement(this)
                {
                    ZOffset      = 10,
                    DimAlignment = DimAlignments.Both | DimAlignments.IgnorePadding,
                    ShareCursor  = true,
                };
            }
コード例 #2
0
        public NewUserSignUpPage()
        {
            On <iOS>().SetUseSafeArea(true);

            BackgroundColor = Color.FromHex("#2980b9");

            _usernameEntry = new UnderlinedEntry("Username", AutomationIdConstants.NewUserSignUpPage_NewUserNameEntry)
            {
                ReturnType = ReturnType.Next
            };

            _passwordEntry = new UnderlinedEntry("Password", AutomationIdConstants.NewUserSignUpPage_NewPasswordEntry)
            {
                IsPassword    = true,
                ReturnType    = ReturnType.Go,
                ReturnCommand = new Command(() => HandleSaveUsernameButtonClicked(_saveUsernameButton, EventArgs.Empty))
            };

            _saveUsernameButton = new BorderedButton("Save Username", AutomationIdConstants.NewUserSignUpPage_SaveUsernameButton)
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.EndAndExpand
            };
            _saveUsernameButton.Clicked += HandleSaveUsernameButtonClicked;

            _cancelButton = new BorderedButton("Cancel", AutomationIdConstants.NewUserSignUpPage_CancelButton)
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.End
            };

            _cancelButton.Clicked += (object sender, EventArgs e) =>
            {
                Navigation.PopModalAsync();
            };

            var layout = new StackLayout
            {
                Padding         = new Thickness(20, 50, 20, 20),
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children        =
                {
                    new WhiteTextLabel("Please enter username"),
                    _usernameEntry,
                    new WhiteTextLabel("Please enter password"),
                    _passwordEntry,
                    _saveUsernameButton,
                    _cancelButton
                }
            };

            Content = new Xamarin.Forms.ScrollView {
                Content = layout
            };
        }
コード例 #3
0
ファイル: Dialog.cs プロジェクト: XZelnar/MicroWorld
        public override void Initialize()
        {
            Layer = 900;

            skip            = new BorderedButton((int)position.X + 78, (int)position.Y + 78, 80, 16, "Skip dialog");
            skip.onClicked += new Button.ClickedEventHandler(skip_onClicked);
            skip.background = Color.White * 0.7f;
            controls.Add(skip);

            base.Initialize();
        }