/// <summary> /// Make a shadow copy of the element at the current state which stays available even the element is gone. /// </summary> /// <returns>A shadow copy of the current element.</returns> public new BasicComboBoxData GetDataCopy() { var data = new BasicComboBoxData(); FillData(data); data.SelectedItem = GetSafeData(() => { if (SelectedItem == null) { return(null); } return(SelectedItem.GetDataCopy()); }); var items = new List <BasicComboBoxItemData>(); data.Items = items; try { foreach (var item in Items) { if (item != null) { items.Add(item.GetDataCopy()); } } } catch { } data.Text = GetSafeData(() => Text); data.IsReadOnly = GetSafeData(() => IsReadOnly); data.IsExpanded = GetSafeData(() => IsExpanded); return(data); }
/// <summary> /// Make a shadow copy of the element at the current state which stays available even the element is gone. /// </summary> /// <returns>A shadow copy of the current element.</returns> public new BasicTabControlData GetDataCopy() { var data = new BasicTabControlData(); FillData(data); data.SelectedItem = GetSafeData(() => { if (SelectedItem == null) { return(null); } return(SelectedItem.GetDataCopy()); }); var items = new List <BasicTabItemData>(); data.Items = items; try { foreach (var item in Items) { if (item != null) { items.Add(item.GetDataCopy()); } } } catch { } return(data); }