Esempio n. 1
0
        public RadioCellTestViewModel()
        {
            RadioItems.AddRange(new List <RadioItem> {
                new RadioItem {
                    Name = "TypeA", Value = 1
                },
                new RadioItem {
                    Name = "TypeB", Value = 2
                },
                new RadioItem {
                    Name = "TypeC", Value = 3
                },
                new RadioItem {
                    Name = "TypeD", Value = 4
                },
                new RadioItem {
                    Name = "TypeE", Value = 5
                },
                new RadioItem {
                    Name = "TypeF", Value = 6
                },
            });

            Selected.Value = RadioItems[1];
        }
        public MainPageViewModel()
        {
            RadioItems = new RadioItems();

            for (int i = 0; i < 5; i++)
            {
                RadioItems.Add(new RadioItem
                {
                    Text    = i.ToString(),
                    Toggled = false
                });
            }
        }
Esempio n. 3
0
        protected override void CellChanged(object obj)
        {
            base.CellChanged(obj);

            var text = (obj as Label).Text;

            switch (text)
            {
            case nameof(OwnAccentColor):
                NextVal(OwnAccentColor, AccentColors);
                break;

            case nameof(ToggleGlobal):
                if (!ToggleGlobal.Value)
                {
                    Selected       = null;
                    GlobalSelected = new ReactiveProperty <RadioItem>(RadioItems[1]);
                }
                else
                {
                    GlobalSelected = null;
                    Selected       = new ReactiveProperty <RadioItem>(RadioItems[1]);
                }
                ToggleGlobal.Value = !ToggleGlobal.Value;
                RaisePropertyChanged(nameof(Selected));
                RaisePropertyChanged(nameof(GlobalSelected));
                break;

            case "ChangeValue":
                if (!ToggleGlobal.Value)
                {
                    NextVal(Selected, RadioItems.ToArray());
                }
                else
                {
                    NextVal(GlobalSelected, RadioItems.ToArray());
                }
                break;
            }
        }
        protected override void Execute(CodeActivityContext context)
        {
            Initialize(context);
            RadioGroupTab radioGroupTab;

            radioItems = RadioItems.Get(context);
            spacing    = RadioSpacing.Get(context);

            string[] radioLabels    = radioItems.Split(',');
            int      radioItemCount = radioLabels.Length;

            if (anchorText != null)
            {
                generateRadioLabels(radioLabels, anchorText, offsetX, offsetY, doc.documentId, pageNumber, toolTip, tabLabel, bold, italic, underline, font, fontColor, fontSize, spacing, radioItemCount);
                radioGroupTab = new RadioGroupTab(anchorText, offsetX, offsetY, doc.documentId, pageNumber, toolTip, tabLabel, spacing, radioItemCount, Required, Shared);
            }
            else
            {
                generateRadioLabels(radioLabels, sigX, sigY, doc.documentId, pageNumber, toolTip, tabLabel, bold, italic, underline, font, fontColor, fontSize, spacing, radioItemCount);
                radioGroupTab = new RadioGroupTab(sigX, sigY, doc.documentId, pageNumber, toolTip, tabLabel, spacing, radioItemCount, Required, Shared);
            }

            AddTabToRecipient(radioGroupTab);
        }