Ejemplo n.º 1
0
        private StackLayout StackLayout()
        {
            var st = new StackLayout
            {
                Orientation      = StackOrientation.Vertical,
                InputTransparent = true
            };

            st.Children.Add(new Label
            {
                Text = WizzardPages[_step].Title
            });

            st.Children.Add(new Label
            {
                Text = WizzardPages[_step].Info
            });

            st.Children.Add(new Label
            {
                Text = WizzardPages[_step].Info2
            });
            if (WizzardPages[_step].Items is List <ICRViewElements> items)
            {
                foreach (var item in items)
                {
                    if (item is CheckBoxElement)
                    {
                        var newButton = new CRButton()
                        {
                            Text      = item.Text,
                            Value     = item.Value,
                            TextColor = Color.Black,
                            FontSize  = 18,
                            BackgroundColorInactive = Color.AliceBlue,
                            BackgroundColorActive   = Color.Orange,
                            HeightRequest           = 40,
                            Command = CheckBoxOnClickedCommand
                        };

                        st.Children.Add(newButton);
                    }

                    if (item is RadioButtonElement)
                    {
                        var newButton = new CRButton()
                        {
                            Text                    = item.Text,
                            Value                   = item.Value,
                            TextColor               = Color.Black,
                            FontSize                = 14,
                            IsRadioButton           = true,
                            BackgroundColorInactive = Color.AliceBlue,
                            BackgroundColorActive   = Color.Orange,
                            HeightRequest           = 40,
                            Command                 = RadioOnClickedCommand
                        };

                        st.Children.Add(newButton);
                    }
                }
            }

            st.Children.Add(btn);
            return(st);
        }
Ejemplo n.º 2
0
        private void DrawWizzardContiner()
        {
            _absoluteLayout.Children.Clear();

            if (WizzardPages == null)
            {
                return;
            }

            var i = 0;

            foreach (var page in WizzardPages)
            {
                var pag = new StackLayout
                {
                    WidthRequest    = ViewWidth,
                    BackgroundColor = Color.CadetBlue
                };

                var buntt = new Button
                {
                    Text = "new button"
                };
                buntt.Clicked += (sender, args) => { App.Current.MainPage.DisplayAlert("o", "m", "G"); };

                pag.Children.Add(buntt);
                //if (i == 0)
                {
                    //pag.Children.Add(new Label { Text = $"box1 {i}" }, Constraint.RelativeToParent((parent) =>
                    //    {
                    //        return 0;
                    //    }),
                    //    Constraint.RelativeToParent((parent) =>
                    //    {
                    //        return 0;
                    //    }),
                    //    Constraint.Constant(50), Constraint.Constant(50));

                    //pag.Children.Add(new Label { Text = $"box2 {i}" }, Constraint.RelativeToParent((parent) =>
                    //    {
                    //        return (.5 * parent.Width) - 50;
                    //    }),
                    //    Constraint.RelativeToParent((parent) =>
                    //    {
                    //        return (.5 * parent.Height) - 50;
                    //    }),
                    //    Constraint.Constant(50), Constraint.Constant(50));


                    var st = new StackLayout
                    {
                        Orientation = StackOrientation.Vertical
                    };

                    pag.Children.Add(new Label
                    {
                        Text = page.Title
                    });

                    pag.Children.Add(new Label
                    {
                        Text = page.Info
                    });

                    pag.Children.Add(new Label
                    {
                        Text = page.Info2
                    });



                    if (page.Items is List <ICRViewElements> items)
                    {
                        foreach (var item in items)
                        {
                            if (item is CheckBoxElement)
                            {
                                var newButton = new CRButton()
                                {
                                    Text      = item.Text,
                                    Value     = item.Value,
                                    TextColor = Color.Black,
                                    FontSize  = 18,
                                    BackgroundColorInactive = Color.AliceBlue,
                                    BackgroundColorActive   = Color.Orange,
                                    HeightRequest           = 40,
                                    Command = CheckBoxOnClickedCommand
                                };

                                pag.Children.Add(newButton);
                            }

                            if (item is RadioButtonElement)
                            {
                                var newButton = new CRButton()
                                {
                                    Text                    = item.Text,
                                    Value                   = item.Value,
                                    TextColor               = Color.Black,
                                    FontSize                = 14,
                                    IsRadioButton           = true,
                                    BackgroundColorInactive = Color.AliceBlue,
                                    BackgroundColorActive   = Color.Orange,
                                    HeightRequest           = 40,
                                    Command                 = RadioOnClickedCommand
                                };

                                pag.Children.Add(newButton);
                            }
                        }
                    }

                    //pag.Content = st;
                }

                AbsoluteLayout.SetLayoutBounds(pag, new Rectangle((i == 0) ? i : ViewWidth,
                                                                  0,
                                                                  ViewWidth,
                                                                  800));
                AbsoluteLayout.SetLayoutFlags(pag, AbsoluteLayoutFlags.None);

                _absoluteLayout.Children.Add(pag);
                i++;
            }
            //DrawHiddenContentView();
        }
Ejemplo n.º 3
0
        void ReleaseDesignerOutlets()
        {
            if (AbilityArea != null)
            {
                AbilityArea.Dispose();
                AbilityArea = null;
            }

            if (AlignmentButton != null)
            {
                AlignmentButton.Dispose();
                AlignmentButton = null;
            }

            if (CharismaButton != null)
            {
                CharismaButton.Dispose();
                CharismaButton = null;
            }

            if (ClassButton != null)
            {
                ClassButton.Dispose();
                ClassButton = null;
            }

            if (ConstitutionButton != null)
            {
                ConstitutionButton.Dispose();
                ConstitutionButton = null;
            }

            if (CRButton != null)
            {
                CRButton.Dispose();
                CRButton = null;
            }

            if (CreatureSubtypeButton != null)
            {
                CreatureSubtypeButton.Dispose();
                CreatureSubtypeButton = null;
            }

            if (CreatureTypeButton != null)
            {
                CreatureTypeButton.Dispose();
                CreatureTypeButton = null;
            }

            if (DexterityButton != null)
            {
                DexterityButton.Dispose();
                DexterityButton = null;
            }

            if (HeaderArea != null)
            {
                HeaderArea.Dispose();
                HeaderArea = null;
            }

            if (InitButton != null)
            {
                InitButton.Dispose();
                InitButton = null;
            }

            if (IntelligenceButton != null)
            {
                IntelligenceButton.Dispose();
                IntelligenceButton = null;
            }

            if (NameButton != null)
            {
                NameButton.Dispose();
                NameButton = null;
            }

            if (RaceButton != null)
            {
                RaceButton.Dispose();
                RaceButton = null;
            }

            if (SensesButton != null)
            {
                SensesButton.Dispose();
                SensesButton = null;
            }

            if (SizeButton != null)
            {
                SizeButton.Dispose();
                SizeButton = null;
            }

            if (StrengthButton != null)
            {
                StrengthButton.Dispose();
                StrengthButton = null;
            }

            if (WisdomButton != null)
            {
                WisdomButton.Dispose();
                WisdomButton = null;
            }
        }