/// <summary> /// </summary> public static void LoadPlugins() { var pluginsDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Plugins"); App.Plugins.LoadPlugins(pluginsDirectory); foreach (PluginInstance pluginInstance in App.Plugins.Loaded) { TabItemHelper.LoadPluginTabItem(pluginInstance); } AppViewModel.Instance.HasPlugins = App.Plugins.Loaded.Count > 0; }
public MainWindow() { InitializeComponent(); TabView.NewItemFactory = () => { var newItem = new TabItem { Header = "New Document" }; TabItemHelper.SetIcon(newItem, new SymbolIcon(Symbol.Document)); return(newItem); }; }
public MainWindow() { InitializeComponent(); LogHandlerSingleton.Instance().Setup(_logControl); TabItemHelper.SetIcon(_generalTab, new SymbolIcon(Symbol.Repair)); TabItemHelper.SetIcon(_hotSamplingTab, new SymbolIcon(Symbol.FullScreen)); TabItemHelper.SetIcon(_configurationTab, new SymbolIcon(Symbol.Setting)); TabItemHelper.SetIcon(_themeTab, new SymbolIcon(Symbol.Highlight)); TabItemHelper.SetIcon(_keybindingsTab, new SymbolIcon(Symbol.Keyboard)); TabItemHelper.SetIcon(_logTab, new SymbolIcon(Symbol.OpenFile)); TabItemHelper.SetIcon(_aboutTab, new SymbolIcon(Symbol.People)); this.MinHeight = this.Height; this.MinWidth = this.Width; }
/// <summary> /// </summary> public static void LoadTabs() { if (Constants.XSettings != null) { foreach (var xElement in Constants.XSettings.Descendants() .Elements("Tab")) { var xKey = (string)xElement.Attribute("Key"); var xValue = (string)xElement.Element("Value"); var xRegularExpression = (string)xElement.Element("RegularExpression"); if (String.IsNullOrWhiteSpace(xKey) || String.IsNullOrWhiteSpace(xValue)) { continue; } xRegularExpression = String.IsNullOrWhiteSpace(xRegularExpression) ? "*" : xRegularExpression; TabItemHelper.AddTabByName(xKey, xValue, xRegularExpression); } } }
private TabItem CreateNewTab(int index) { TabItem newItem = new TabItem(); newItem.Header = $"Document {index}"; TabItemHelper.SetIcon(newItem, new SymbolIcon(Symbol.Document)); // The content of the tab is often a frame that contains a page, though it could be any UIElement. Frame frame = new Frame { NavigationUIVisibility = NavigationUIVisibility.Hidden, IsTabStop = false }; frame.Navigated += (s, e) => { ((Page)frame.Content).Margin = new Thickness(-18, 0, -18, 0); }; switch (index % 3) { case 0: frame.Navigate(SamplePageSources.SamplePage1); break; case 1: frame.Navigate(SamplePageSources.SamplePage2); break; case 2: frame.Navigate(SamplePageSources.SamplePage3); break; } newItem.Content = frame; return(newItem); }
private TabItem CreateNewTab(int index) { TabItem newItem = new TabItem(); newItem.Header = $"Document {index}"; TabItemHelper.SetIcon(newItem, new FontIcon { Glyph = "\uE130 " }); // The content of the tab is often a frame that contains a page, though it could be any UIElement. Frame frame = new Frame(); frame.Navigated += (s, e) => { ((Page)frame.Content).Margin = new Thickness(-18, 0, -18, 0); }; switch (index % 3) { case 0: frame.Navigate(new SamplePage1()); break; case 1: frame.Navigate(new SamplePage2()); break; case 2: frame.Navigate(new SamplePage3()); break; } newItem.Content = frame; return(newItem); }