Inheritance: Xamarin.Forms.StackLayout
        public void InitControls(TreeMapPrItem navigationObjects)
        {
            {
                var navTree = GetNavMenuTree (navigationObjects);

                navControl.InitControl (navTree);
                navControl.SetBinding (ContentView.IsEnabledProperty, new Binding ("ShowLoadingAnimationInverted"));
            }

            if (Device.OS == TargetPlatform.Android) {
                {
                    var goalGroup = new BindableRadioGroup () { Orientation = StackOrientation.Horizontal };
                    goalGroup.ItemsSource = new List<string> () { "нефть", "обводненность" };
                    goalGroup.SelectedIndex = 1;
                    goalGroup.SelectedIndex = 0;
                    goalGroup.CheckedChanged += ViewModel.OnSelectedGoalChanged;
                    cnvGoal.Content = goalGroup;
                }

                {
                    var rowCountGroup = new BindableRadioGroup () { Orientation = StackOrientation.Horizontal };
                    rowCountGroup.ItemsSource = new List<string> () { "50", "100", "300" };
                    rowCountGroup.SelectedIndex = 1;
                    rowCountGroup.SelectedIndex = 0;
                    rowCountGroup.CheckedChanged += ViewModel.OnSelectedCountChanged;
                    cnvRowCount.Content = rowCountGroup;
                }

            } else {
                {
                    var goalSegmentView = new SegmentedControlView ();
                    goalSegmentView.SegmentsItens = "нефть;обводненность";
                    goalSegmentView.TintColor = Color.FromHex ("#4487CA");
                    goalSegmentView.PropertyChanged += OnGoalChanged;
                    cnvGoal.Content = goalSegmentView;
                }

                {
                    var rowCountSegmentView = new SegmentedControlView ();
                    rowCountSegmentView.SegmentsItens = "50;100;300";
                    rowCountSegmentView.TintColor = Color.FromHex ("#4487CA");
                    rowCountSegmentView.PropertyChanged += OnRowCountChanged;
                    cnvRowCount.Content = rowCountSegmentView;
                }
            }

            {
                Switch swt;
                if (Device.OS == TargetPlatform.Android) {
                    swt = new Switch (){ HorizontalOptions = LayoutOptions.End };
                } else {
                    swt = new ExtendedSwitch (){ HorizontalOptions = LayoutOptions.End, TintColor = Color.FromHex ("#D64B30") };
                }
                swt.SetBinding (Switch.IsToggledProperty, new Binding ("IsRedColor"));
                swt.SetBinding (View.IsEnabledProperty, new Binding ("ShowLoadingAnimationInverted"));

                Grid.SetColumn (swt, 2);
                grdRed.Children.Add (swt);
            }

            {
                Switch swt;
                if (Device.OS == TargetPlatform.Android) {
                    swt = new Switch (){ HorizontalOptions = LayoutOptions.End };
                } else {
                    swt = new ExtendedSwitch (){ HorizontalOptions = LayoutOptions.End, TintColor = Color.FromHex ("#189A55") };
                }
                swt.SetBinding (Switch.IsToggledProperty, new Binding ("IsGreenColor"));
                swt.SetBinding (View.IsEnabledProperty, new Binding ("ShowLoadingAnimationInverted"));

                Grid.SetColumn (swt, 2);
                grdGreen.Children.Add (swt);
            }

            {
                Switch swt;
                if (Device.OS == TargetPlatform.Android) {
                    swt = new Switch (){ HorizontalOptions = LayoutOptions.End };
                } else {
                    swt = new ExtendedSwitch (){ HorizontalOptions = LayoutOptions.End, TintColor = Color.FromHex ("#D1AA12") };
                }
                swt.SetBinding (Switch.IsToggledProperty, new Binding ("IsYellowColor"));
                swt.SetBinding (View.IsEnabledProperty, new Binding ("ShowLoadingAnimationInverted"));

                Grid.SetColumn (swt, 2);
                grdYellow.Children.Add (swt);
            }
        }
        public QuotaControl(DataRow row, string QuotaFieldValue)
        {
            var label = new Label();

            label.Text      = row["Caption"].ToString();
            label.TextColor = Color.Black;
            label.FontSize  = 15;

            QuotaFieldName = row["FieldName"].ToString();
            try
            {
                Type = (int)row["Type"];
            }
            catch
            {
            }

            try
            {
                ShowCode = row["ShowCode"].ToString();
            }
            catch
            {
            }

            string valueOptions = row["OptionValues"].ToString();


            if (Type == 2)
            {
                try
                {
                    int indexSelected = -1;

                    var tblValue = JsonConvert.DeserializeObject <List <QuotaControlField> >(valueOptions);
                    var items    = new List <String>();
                    for (int j = 0; j < tblValue.Count; j++)
                    {
                        var item = tblValue[j];
                        if (ShowCode == "1")
                        {
                            items.Add(item.OptionFieldValue + ". " + item.OptionFieldName);
                        }
                        else
                        {
                            items.Add(item.OptionFieldName);
                        }

                        listID.Add(item.OptionFieldValue);

                        if (item.OptionFieldValue == QuotaFieldValue)
                        {
                            indexSelected = j;
                        }
                    }

                    pick             = new Picker();
                    pick.ItemsSource = items;

                    try
                    {
                        pick.SelectedIndex = indexSelected;
                    }
                    catch (Exception ex)
                    {
                    }

                    this.Children.Add(label);
                    this.Children.Add(pick);
                }
                catch (Exception ex)
                {
                }
            }
            if (Type == 1)
            {
                try
                {
                    var tblValue = JsonConvert.DeserializeObject <List <QuotaControlField> >(valueOptions);
                    groupOptions = new XLabs.Forms.Controls.BindableRadioGroup();
                    foreach (QuotaControlField item in tblValue)
                    {
                        MyRadioButton op = new MyRadioButton();
                        if (ShowCode == "1")
                        {
                            op.Text = item.OptionFieldValue + ". " + item.OptionFieldName;
                        }
                        else
                        {
                            op.Text = item.OptionFieldName;
                        }
                        op.FieldValue = item.OptionFieldValue;
                        if (item.OptionFieldValue.Trim().ToUpper() == QuotaFieldValue.Trim().ToUpper())
                        {
                            op.Checked = true;
                        }

                        op.CheckedChanged += option_CheckedChange;
                        groupOptions.Children.Add(op);
                    }
                    this.Children.Add(label);
                    this.Children.Add(groupOptions);
                }
                catch (Exception ex)
                {
                }
            }
        }