/// <summary> /// Конструктор редактора. /// </summary> /// <param name="TabItemView">Собственный TAB компонент</param> public void Construct(HeaderedItemViewModel TabItemView) { this.TabItemView = TabItemView; GeneralLogic.HeaderName = TabItemView.Header.ToString(); Start(); WindowActions(); CustomTimer.Create(delegate(object sender, EventArgs e) { GeneralLogic.RequestMethod_SetComboBoxItem(ComboBox_RequestType); if (RequestDirectory != null) { int NetworkUid = Guid.NewGuid().GetHashCode(); GeneralLogic.LoadRequestDirectory(this, NetworkUid); LEditorNetworkActions.RequestParamsItemsGet_Confirm(this, NetworkUid); } else { GeneralLogic.SetHeaderName(TabItemView); } }, new TimeSpan(0, 0, 0, 0, 500)); }
private void OnDragCompleted(object sender, RoutedPropertyChangedEventArgs <bool> e) { if (e.NewValue) { FocusManager.ForceFocused = true; //FocusTimer.Enabled = false; return; } var newOrder = TabControl.GetOrderedHeaders(); var old = new HeaderedItemViewModel[VM.TabVMs.Count]; VM.TabVMs.CopyTo(old, 0); var same = true; var items = newOrder.ToList(); for (var i = 0; i < items.Count; i++) { if (old[i].Header != items.ToList()[i].Content) { same = false; break; } } if (same) { return; } VM.TabVMs.Clear(); foreach (var tab in items) { VM.TabVMs.Add(old.FirstOrDefault(x => x.Header == tab.Content)); } FocusManager.ForceFocused = false; }
public void SetHeaderName(HeaderedItemViewModel TabItemView) { if (IsCopy) { TabItemView.Header = "[Copy] " + HeaderName + " - " + RequestMethod; } else { TabItemView.Header = HeaderName + " - " + RequestMethod; } }
public static HeaderedItemViewModel New() { var item = new EmptyTab(); var tab = new HeaderedItemViewModel() { Header = "New Tab", Content = item }; item.TabView = tab; return(tab); }
private void Branch(Orientation orientation) { var branchResult = Layout.Branch(_tabablzControl, orientation, false, SplitRatio / 10); var newItem = new HeaderedItemViewModel { Header = "Code-Wise", Content = "This item was added in via code, using Layout.Branch, and TabablzControl.AddToSource" }; branchResult.TabablzControl.AddToSource(newItem); branchResult.TabablzControl.SelectedItem = newItem; }
private void Branch(Orientation orientation) { var branchResult = Layout.Branch(_tabablzControl, GetNew(_tabablzControl), orientation, false, SplitRatio / 10); var newItem = new HeaderedItemViewModel { Header = "Layout Info", Content = new LayoutManagementExample { DataContext = new LayoutManagementExampleViewModel() } }; branchResult.TabablzControl.AddToSource(newItem); branchResult.TabablzControl.SelectedItem = newItem; }
public static HeaderedItemViewModel AddTab(string Header = "Новый запрос", ModelRequestDirectory RequestDirectory = null) { var Content = new EditorWebRequestControl(RequestDirectory); var TabItemView = new HeaderedItemViewModel() { Header = Header, Content = Content }; //Content.Construct(TabItemView, RequestDirectory); ((EditorWebRequestControl)TabItemView.Content) .Construct(TabItemView); return(TabItemView); }
public void SetCurrentTabContent(string title, UserControl control, bool newtab) { MenuFlyout.IsOpen = false; //hide menu if (newtab) { var model = new HeaderedItemViewModel { Header = title, Content = control }; int index = TabControl.Items.Add(model); TabControl.SelectedIndex = index; } else { var selected = TabControl.SelectedItem as HeaderedItemViewModel; selected.Header = title; selected.Content = control; } }
public static HeaderedItemViewModel AddHistoryTab(string Header, WebRequestHistory HistoryItem) { var Content = new EditorWebRequestControl(); var TabItemView = new HeaderedItemViewModel() { Header = Header, Content = Content }; //Content.Construct(TabItemView, RequestDirectory); ((EditorWebRequestControl)TabItemView.Content) .SetHistory(HistoryItem); ((EditorWebRequestControl)TabItemView.Content) .Construct(TabItemView); return(TabItemView); }