private void Button_Click(object sender, RoutedEventArgs e) { Button button = (Button)sender; AppID.Remove((int)button.Tag); DataHandle.SaveIds(AppID.ToList()); }
private void SendButton_Click(object sender, RoutedEventArgs e) { var isNumeric = int.TryParse(GameIdInput.Text, out int n); if (isNumeric) { AppID.Add(n); } GameIdInput.Clear(); DataHandle.SaveIds(AppID.ToList()); }
} //inotifypropetychanged on list / binding mmvm lite/prison public MainWindow() { InitializeComponent(); AppID = new ObservableCollection <int>(DataHandle.LoadIds()); Items = new ObservableCollection <newsitem>(SteamLoadData.GetNewsByIDs(AppID.ToList())); AllItems.ItemsSource = Items = new ObservableCollection <newsitem>(SteamLoadData.GetNewsByIDs(AppID.ToList())); AllGames.ItemsSource = AppID; NewsWindow.Visibility = Visibility.Visible; GameEditWindow.Visibility = Visibility.Hidden; if (Items.Count() == 0) { IsEmpty.Visibility = Visibility.Visible; } }