Esempio n. 1
0
        private void addCategoriesRadioButtons()
        {
            m_GeneralCategoryRadioButton           = new SfRadioButton();
            m_FoodCategoryRadioButton              = new SfRadioButton();
            m_HistoryCategoryRadioButton           = new SfRadioButton();
            m_SportCategoryRadioButton             = new SfRadioButton();
            m_NatureCategoryRadioButton            = new SfRadioButton();
            m_GeneralCategoryRadioButton.IsChecked = true;
            m_GeneralCategoryRadioButton.SetTitle("General", UIControlState.Normal);
            m_FoodCategoryRadioButton.SetTitle("Food", UIControlState.Normal);
            m_HistoryCategoryRadioButton.SetTitle("History", UIControlState.Normal);
            m_SportCategoryRadioButton.SetTitle("Sport", UIControlState.Normal);
            m_NatureCategoryRadioButton.SetTitle("Nature", UIControlState.Normal);
            m_GeneralCategoryRadioButton.Font = UIFont.FromName("Arial", 15);
            m_FoodCategoryRadioButton.Font    = UIFont.FromName("Arial", 15);
            m_HistoryCategoryRadioButton.Font = UIFont.FromName("Arial", 15);
            m_SportCategoryRadioButton.Font   = UIFont.FromName("Arial", 15);
            m_NatureCategoryRadioButton.Font  = UIFont.FromName("Arial", 15);

            categoriesRadioGroup.AddArrangedSubview(m_GeneralCategoryRadioButton);
            categoriesRadioGroup.AddArrangedSubview(m_FoodCategoryRadioButton);
            categoriesRadioGroup.AddArrangedSubview(m_HistoryCategoryRadioButton);
            categoriesRadioGroup.AddArrangedSubview(m_SportCategoryRadioButton);
            categoriesRadioGroup.AddArrangedSubview(m_NatureCategoryRadioButton);
        }
Esempio n. 2
0
        private void SfRadioButton_StateChanged(object sender, StateChangedEventArgs e)
        {
            Console.WriteLine("Triggering this function " + sender);
            SfRadioButton sfRadioButton = sender as SfRadioButton;

            SelectedAddressTagName = sfRadioButton.Text.ToLower();
        }
Esempio n. 3
0
 private void addMarkStyleRadioButtons()
 {
     m_WoodMarkStyleRadioButton           = new SfRadioButton();
     m_MetalMarkStyleRadioButton          = new SfRadioButton();
     m_SchoolMarkStyleRadioButton         = new SfRadioButton();
     m_WoodMarkStyleRadioButton.IsChecked = true;
     markStyleRadioGroup.AddArrangedSubview(m_WoodMarkStyleRadioButton);
     markStyleRadioGroup.AddArrangedSubview(m_MetalMarkStyleRadioButton);
     markStyleRadioGroup.AddArrangedSubview(m_SchoolMarkStyleRadioButton);
 }
Esempio n. 4
0
        private void configureMarital()
        {
            if (maritalConfigured == true)
            {
                return;
            }

            var groupKey = new SfRadioGroupKey();

            var translator = new TranslateExtension();

            translator.Text = "EnumMaritalSingle";

            this.singleRadio = new SfRadioButton {
                Text = (string)translator.ProvideValue(null)
            };
            singleRadio.GroupKey = groupKey;

            translator.Text   = "EnumMaritalMarried";
            this.marriedRadio = new SfRadioButton {
                Text = (string)translator.ProvideValue(null)
            };
            marriedRadio.GroupKey = groupKey;

            translator.Text    = "EnumMaritalDivorced";
            this.divorcedRadio = new SfRadioButton {
                Text = (string)translator.ProvideValue(null)
            };
            divorcedRadio.GroupKey = groupKey;

            translator.Text = "EnumMaritaWidow";
            this.widowRadio = new SfRadioButton {
                Text = (string)translator.ProvideValue(null)
            };
            widowRadio.GroupKey = groupKey;


            //var flex = new FlexLayout();
            flex.Wrap           = FlexWrap.Wrap;
            flex.Direction      = FlexDirection.Row;
            flex.JustifyContent = FlexJustify.SpaceBetween;

            flex.Children.Add(singleRadio);
            flex.Children.Add(marriedRadio);
            flex.Children.Add(divorcedRadio);
            flex.Children.Add(widowRadio);

            var context = registerTbView.BindingContext as SignUpPageViewModel;

            maritalConfigured = true;

            if (context == null)
            {
                return;
            }

            widowRadio.IsChecked     = context.Marital == Backend.Core.Types.MaritalStatus.Widow;
            widowRadio.StateChanged += (src, arg) =>
            {
                if (widowRadio.IsChecked == true)
                {
                    context.Marital = Backend.Core.Types.MaritalStatus.Widow;
                }
            };

            divorcedRadio.IsChecked     = context.Marital == Backend.Core.Types.MaritalStatus.Divorced;
            divorcedRadio.StateChanged += (src, arg) =>
            {
                if (divorcedRadio.IsChecked == true)
                {
                    context.Marital = Backend.Core.Types.MaritalStatus.Divorced;
                }
            };

            marriedRadio.IsChecked     = context.Marital == Backend.Core.Types.MaritalStatus.Married;
            marriedRadio.StateChanged += (src, arg) =>
            {
                if (marriedRadio.IsChecked == true)
                {
                    context.Marital = Backend.Core.Types.MaritalStatus.Married;
                }
            };

            singleRadio.IsChecked     = context.Marital == Backend.Core.Types.MaritalStatus.Single;
            singleRadio.StateChanged += (src, arg) =>
            {
                if (singleRadio.IsChecked == true)
                {
                    context.Marital = Backend.Core.Types.MaritalStatus.Single;
                }
            };
        }
        private void InitializeBase()
        {
            // ChildForm child_form = new ChildForm();
            // OnAppearing();
            // radiogroupLayout = new StackLayout();
            habit_      = null;
            habit_data  = null;
            all_content = new StackLayout();
            Base_Stack.Children.Insert(1, all_content);

            child_form = new One_Time();
            Variable_Content.Content = child_form.Content;
            SfRadioGroupKey radioGroup = new SfRadioGroupKey();
            SfRadioButton   one_time   = new SfRadioButton();

            one_time.IsChecked                 = true;
            one_time.Text                      = "One Time";
            nameEntry                          = new Entry();
            nameEntry.Placeholder              = "I made the decision to";
            radiogrouplayout                   = new StackLayout();
            radiogrouplayout.Orientation       = Xamarin.Forms.StackOrientation.Horizontal;
            radiogroupLayout.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand;
            all_content.Children.Insert(0, nameEntry);
            all_content.Children.Insert(1, radiogroupLayout);


            SfRadioButton recurring = new SfRadioButton();

            recurring.Text = "Recurring";
            SfRadioButton bulk = new SfRadioButton();

            bulk.Text = "Bulk Purchase";

            one_time.GroupKey                  = radioGroup;
            recurring.GroupKey                 = radioGroup;
            bulk.GroupKey                      = radioGroup;
            bulk.HorizontalOptions             = Xamarin.Forms.LayoutOptions.FillAndExpand;
            radiogroupLayout.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand;
            radiogroupLayout.Children.Add(one_time);
            radiogroupLayout.Children.Add(recurring);
            radiogroupLayout.Children.Add(bulk);
            radiogroupcontrollers = new Dictionary <string, SfRadioButton> {
            };
            foreach (SfRadioButton child in radiogroupLayout.Children)
            {
                radiogroupcontrollers[child.Text] = child;
            }
            radiogroupLayout.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand;
            one_time.StateChanged  += RadioButton_StateChanged;
            recurring.StateChanged += RadioButton_StateChanged;
            bulk.StateChanged      += RadioButton_StateChanged;
            nameEntry.Text          = string.Empty;
            typePicker.IsVisible    = false;


            moneySaved.TextChanged += let_refresh;
            nameEntry.TextChanged  += let_refresh;
            this.set_helper();


            //Add_stash.Clicked += btnPopupButton_Clicked;
            //child_form.refresh();
        }
Esempio n. 6
0
        public void ShowSortingPopUp <T>(string buttonText, View element, List <Models.SortOption> SortOptions, T request, Func <Task> ucitajProizvodeCallback)
        {
            this.sortOptions             = SortOptions;
            this.requestType             = typeof(T);
            this.request                 = request;
            this.ucitajProizvodeCallback = ucitajProizvodeCallback;
            DataTemplate templateView;
            Grid         layout;

            templateView = new DataTemplate(() =>
            {
                layout        = new Grid();
                layout.Margin = new Thickness(10, 10, 10, 10);

                var counter = 0;

                layout.RowDefinitions.Add(new RowDefinition {
                    Height = GridLength.Auto
                });

                StackLayout stack = new StackLayout
                {
                    Orientation = StackOrientation.Vertical
                };

                Label label = new Label
                {
                    Text = "Poredak",
                    HorizontalTextAlignment = TextAlignment.Start,
                    VerticalTextAlignment   = TextAlignment.Center,
                    VerticalOptions         = LayoutOptions.Center,
                    FontAttributes          = FontAttributes.Bold,
                    FontFamily = Device.RuntimePlatform == Device.iOS ? "Montserrat-SemiBold" :
                                 Device.RuntimePlatform == Device.Android ? "Montserrat-SemiBold.ttf#Montserrat-SemiBold" : "Assets/Montserrat-SemiBold.ttf#Montserrat-SemiBold"
                };
                stack.Children.Add(label);

                SfRadioGroup radioGroup = new SfRadioGroup();
                radioGroup.Spacing      = 0;
                foreach (var item in sortOptions)
                {
                    SfRadioButton option = new SfRadioButton
                    {
                        Text    = item.Text,
                        Padding = new Thickness {
                            Left = 0, Bottom = 0, Right = 0, Top = 0
                        },
                    };

                    option.IsChecked = GetSortRadioButtonChecked("Poredak", item.Value.ToString());

                    option.StateChanged += SortingOption_StateChanged;
                    radioGroup.Children.Add(option);
                }
                stack.Children.Add(radioGroup);


                layout.Children.Add(stack, 0, counter++);

                layout.RowDefinitions.Add(new RowDefinition {
                    Height = GridLength.Auto
                });
                SfButton button        = new SfButton();
                button.Text            = buttonText;
                button.Margin          = new Thickness(20, 0, 20, 20);
                button.VerticalOptions = LayoutOptions.End;
                button.Clicked        += Button_Clicked1;
                layout.Children.Add(button, 0, counter++);

                var scrollView = new ScrollView()
                {
                    Content = layout, HeightRequest = 150
                };

                return(scrollView);
            });

            this.PopupView.ShowHeader       = false;
            this.PopupView.ShowFooter       = false;
            this.PopupView.HeightRequest    = 300;
            this.PopupView.WidthRequest     = 300;
            this.PopupView.ShowCloseButton  = false;
            this.PopupView.AcceptButtonText = "OK";

            // Adding ContentTemplate of the SfPopupLayout
            this.PopupView.ContentTemplate = templateView;

            //this.ShowRelativeToView(element, RelativePosition.AlignBottom, 0, 0);

            // The default height and width of PopupView is 250 and 300 respectively.
            // You can set any desired values as the height and width of the popup view.

            (double btnX, double btnY) = ScreenCoords.GetScreenCoordinates(element);

            this.Show(btnX - 0, btnY + 75);
        }