diff --git a/Views/MainWindow.axaml b/Views/MainWindow.axaml index 2608fce..1aa6fdf 100644 --- a/Views/MainWindow.axaml +++ b/Views/MainWindow.axaml @@ -35,9 +35,6 @@ Grid.Row="0"> - - - diff --git a/Views/MainWindow.axaml.cs b/Views/MainWindow.axaml.cs index f401f02..163fe5f 100644 --- a/Views/MainWindow.axaml.cs +++ b/Views/MainWindow.axaml.cs @@ -31,10 +31,8 @@ public partial class MainWindow : Window private void OnDatabaseChanged(object? sender, PropertyChangedEventArgs e) { - if (e.PropertyName == nameof(BetterRaidDatabase.OnlyOnline)) - { - GenerateRaidGrid(); - } + InitializeRaidChannels(); + GenerateRaidGrid(); } private void OnDataContextChanged(object? sender, EventArgs e) @@ -62,6 +60,11 @@ public partial class MainWindow : Window private void InitializeRaidChannels() { + foreach (var rbvm in _raidButtonVMs) + { + rbvm.PropertyChanged -= OnChannelDataChanged; + } + _raidButtonVMs.Clear(); var vm = DataContext as MainWindowViewModel; diff --git a/db.json b/db.json index c845b43..a88f587 100644 --- a/db.json +++ b/db.json @@ -1 +1 @@ -{"OnlyOnline":true,"Channels":["Cedricun","ZanTal","PropzMaster","Artimus83","HyperonsLive","theshroomlife","Robocraft999","sllikson","Aron_dc","AIEsports","GronkhTv","TobinatorLP","Lordabgrund"],"AutoSave":true} \ No newline at end of file +{"OnlyOnline":true,"Channels":["Cedricun","ZanTal","PropzMaster","Artimus83","HyperonsLive","theshroomlife","Robocraft999","sllikson","Aron_dc","AIEsports","TobinatorLP","Lordabgrund","GronkhTV"],"AutoSave":true} \ No newline at end of file