private void OpenTab(UnrealProject unrealProject) { foreach (var item in tabs.Items) { if (!((item as TabItem).Content is Frame) || !(((item as TabItem).Content as Frame).Content is ProjectView) || (((item as TabItem).Content as Frame).Content as ProjectView).SelectedUproject == unrealProject) { continue; } tabs.SelectedIndex = tabs.Items.IndexOf(item); return; } var tab = new TabItem { Content = new Frame { Width = 794, Height = 405, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch, VerticalContentAlignment = VerticalAlignment.Stretch, Content = new ProjectView(unrealProject, settings) }, Header = unrealProject.Name, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch, VerticalContentAlignment = VerticalAlignment.Stretch }; tabs.Items.Add(tab); tabs.SelectedIndex = tabs.Items.Count - 1; }
public ProjectView(UnrealProject uproject, JsSettings s) { SelectedUproject = uproject; settings = s; InitializeComponent(); gr.DataContext = this; if (SelectedUproject.JsUnrealProject.Plugins != null) { Plugins.ItemsSource = SelectedUproject.JsUnrealProject.Plugins; } Modules.ItemsSource = SelectedUproject.JsUnrealProject.Modules; }