/// <summary> /// Set the value of IsSelected, update any other TabItems, /// and raise change notification. /// </summary> /// <param name="item">The ModelItem representing a TabItem.</param> /// <param name="value">Value of the TabItem's IsSelected property.</param> public static void SetDesignTimeIsSelected(ModelItem item, bool value) { // If we are setting this one to true, set all the others to false. if (value) { UpdateIsSelectedForOtherTabs(item); } item.SetDesignerProperty(DesignTimeIsSelectedProperty, value); Util.InvalidateProperty(item, MyPlatformTypes.TabItem.IsSelectedProperty); }
/// <summary> /// Set the value of SelectedIndex and raise change notification. /// Make the selected TabItem the Active TabItem. /// </summary> /// <param name="item">Model item for the TabControl.</param> /// <param name="value">The SelectedIndex value.</param> public static void SetDesignTimeSelectedIndex(ModelItem item, int value) { item.SetDesignerProperty(DesignTimeSelectedIndexProperty, value); Util.InvalidateProperty(item, MyPlatformTypes.TabControl.SelectedIndexProperty); ModelProperty content = item.Content; ModelItemCollection tabControlChildCollection = null; // activate the corresponding TabItem if (content != null) { tabControlChildCollection = content.Collection; if (tabControlChildCollection != null && value <= tabControlChildCollection.Count) { TabItemDesignModeValueProvider.SetDesignTimeIsSelected(tabControlChildCollection[value], true); } } }
/// <summary> /// Set the value of CurrentSelectedIndex. /// </summary> /// <param name="item">The model item for a TabControl.</param> /// <param name="value">CurrentSelectedIndex of the TabControl.</param> public static void SetCurrentSelectedIndexPropertyValue(ModelItem item, int value) { item.SetDesignerProperty(CurrentSelectedIndexValueProperty, value); }