public void Start(Model.UI.TabItem tabItem, double width) { try { Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => { this.tabItem = tabItem; this.Background = new SolidColorBrush(Colors.Transparent); this.tabTitle.Content = tabItem.Title; this.Width = width; this.Opacity = 1; MainBorder.BorderThickness = new Thickness(0.5); ColoredBorder.BorderThickness = new Thickness(0.5); ColoredBorder.BorderBrush = tabItem.TabActiveBackColor; this.Show(); })); } catch { } }
private async Task CreateTabForWindow(IntPtr handle, string title) { await Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, (Action)(() => { var windowItem = new HostedWindowItem { WindowHandle = handle, }; var tabItem = new Model.UI.TabItem { IsActive = true, Title = title, HostedWindowItem = windowItem, }; windowItem.TabItem = tabItem; this.Title = title; TabsContainer.AddTab(tabItem); this.ForcePaint(); })); }