public FavoritesResult(MainWindow mw, Favourites f, FavouritesPage favPage) { InitializeComponent(); this.mw = mw; this.f = f; this.favPage = favPage; }
public TabItem AddTabFavorites() { int count = _tabItems.Count; counter++; temp++; // create new tab item TabItem tab = new TabItem(); tab.Header = string.Format("Favorites"); tab.Name = string.Format("tab{0}", counter); tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate; tab.Background = new SolidColorBrush(Color.FromRgb(230, 234, 238)); tab.BorderBrush = Brushes.LightGray; tab.MinWidth = 100; tab.Width = 150; tab.MaxWidth = 150; FavouritesPage page = new FavouritesPage(this, favourites); Grid g = new Grid(); g = page.favorites; page.Content = null; _tabItems.Insert(count - 1, tab); tab.Content = g; return(tab); }
private void clear(object sender, RoutedEventArgs e) { f.clearFavourites(); Grid g = new Grid(); TabItem tab = mw.tabDynamic.SelectedItem as TabItem; FavouritesPage page = new FavouritesPage(mw, f); g = page.favorites; page.Content = null; tab.Content = g; mw.tabDynamic.SelectedItem = tab; }