private void ViewFavoriteGroupButton_Click(object sender, System.Windows.RoutedEventArgs e) { Button button = (Button)sender; FavoriteGroupViewModel group = (FavoriteGroupViewModel)button.DataContext; FavoriteGroupWindow window = new FavoriteGroupWindow(group); window.Closed += Window_Closed; window.Show(); }
public FavoriteGroupWindow(FavoriteGroupViewModel favoriteGroup) { this.favoriteGroup = favoriteGroup; InitializeComponent(); this.Initialize(this.StatusBar); this.Loaded += CurrencyUserEditorWindow_Loaded; }
private async Task RefreshFavoriteGroups() { this.AddFavoriteTeamTextBox.Clear(); this.AddFavoriteUserTextBox.Clear(); this.favoritedGroups.Clear(); foreach (FavoriteGroupModel group in ChannelSession.Settings.FavoriteGroups) { FavoriteGroupViewModel groupViewModel = new FavoriteGroupViewModel(group); await groupViewModel.RefreshGroup(); this.favoritedGroups.Add(groupViewModel); } }
private async void DeleteFavoriteGroupButton_Click(object sender, System.Windows.RoutedEventArgs e) { Button button = (Button)sender; FavoriteGroupViewModel group = (FavoriteGroupViewModel)button.DataContext; await this.Window.RunAsyncOperation(async() => { if (await MessageBoxHelper.ShowConfirmationDialog("Are you sure you wish to remove this group?")) { ChannelSession.Settings.FavoriteGroups.Remove(group.Group); await ChannelSession.SaveSettings(); await this.RefreshFavoriteGroups(); } }); }