private void HeaderButton_Click(object sender, RoutedEventArgs e) { GnosisTileTabItem tabItem = (sender as GnosisToggleButton).CommandParameter as GnosisTileTabItem; int index = (int)tabItem.Tag; this.SelectedIndex = index; }
public void LoadTabItem(IGnosisTileTabItemImplementation tabItemImplementation) { GnosisTileTabItem tabItem = (GnosisTileTabItem)tabItemImplementation; //tabItem.HeaderTemplate = this.FindResource("TabHeader") as DataTemplate; this.Items.Add(tabItem); tabItem.Tag = this.Items.Count - 1; CurrentTileTabItem = tabItem; // string xaml = XamlWriter.Save(this); }
//private void GnosisTileTab_PropertyChanged(object sender, PropertyChangedEventArgs e) //{ // //switch (e.PropertyName) // //{ // //} //} public void SelectTabItem(GnosisTileTabItem item) { CurrentTileTabItem = item; Dispatcher.BeginInvoke((Action)(() => this.SelectedItem = item)); foreach (GnosisTileTabItem child in this.Items) { if (child.HeaderButton != null) { if (child != item) { child.HeaderButton.Active = false; } else { child.HeaderButton.Active = true; } } } }
private void btnClose_Click(object sender, RoutedEventArgs e) { GnosisTileTabItem item = (sender as Button).CommandParameter as GnosisTileTabItem; CloseTabItemHandler.Invoke(item); }