public override void CreateUIElement()
        {
            XamTabControl tab = new XamTabControl();

            tab.MinHeight = Convert.ToDouble(Input.GetInput("MinHeight", 100));
            tab.MinWidth  = Convert.ToDouble(Input.GetInput("MinWidth", 400));
            tab.MaxHeight = Convert.ToDouble(Input.GetInput("MaxHeight", 500));
            tab.MaxWidth  = Convert.ToDouble(Input.GetInput("MaxWidth", 1000));

            int n = GetControlCount();

            for (int i = 0; i < n; i++)
            {
                //Get the control
                IUIControl control = GetControl(i);
                IUIInput   param   = control.Input;

                //Create the tab item
                TabItemEx item         = new TabItemEx();
                string    defaultTitle = (string)param.GetInput("Description", "Item-" + (i + 1).ToString());
                item.Header  = (string)param.GetInput("title", defaultTitle);
                item.Content = control.GetUIElement();

                //Add the tab item to the tab control
                tab.Items.Add(item);
            }

            UtilityMethods.SetPanelResources(tab);
            UIElement = tab;
        }
        private static object OnCoerceSelectemName(DependencyObject d, object baseValue)
        {
            if (baseValue == null)
            {
                return(null);
            }

            XamTabControl tabControl = (XamTabControl)d;
            string        value      = baseValue.ToString();

            if (!string.IsNullOrEmpty(value))
            {
                int index = 0;
                foreach (var item in tabControl.Items)
                {
                    if (((TabItemEx)item).Name == value)
                    {
                        tabControl.SelectedIndex = index;
                        break;
                    }

                    index++;
                }
            }
            return(baseValue);
        }
Beispiel #3
0
 public static string GetSelectedItemName(XamTabControl source)
 {
     return(source.GetValue(SelectedItemNameProperty) as string);
 }
Beispiel #4
0
 public static void SetSelectedItemName(XamTabControl source, object value)
 {
     source.SetValue(SelectedItemNameProperty, value);
 }