From 4b34eeded75db448472699c8023ca2a720255988 Mon Sep 17 00:00:00 2001 From: wieslawsoltes Date: Tue, 1 Oct 2019 08:53:59 +0000 Subject: [PATCH] Fix --- .../ViewModels/ThemeEditorViewModel.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/ThemeEditor/ViewModels/ThemeEditorViewModel.cs b/src/ThemeEditor/ViewModels/ThemeEditorViewModel.cs index b1b3ed9..6b873ca 100644 --- a/src/ThemeEditor/ViewModels/ThemeEditorViewModel.cs +++ b/src/ThemeEditor/ViewModels/ThemeEditorViewModel.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Reactive; @@ -12,7 +14,6 @@ using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Media; using Avalonia.Threading; using ReactiveUI; -using ReactiveUI.Legacy; using ThemeEditor.ViewModels.Serializer; namespace ThemeEditor.ViewModels @@ -20,23 +21,19 @@ namespace ThemeEditor.ViewModels [DataContract] public class ThemeEditorViewModel : ReactiveObject { -#pragma warning disable CS0618 - private IReactiveList? _themes; -#pragma warning restore CS0618 + private IList? _themes; private ThemeViewModel? _currentTheme; private ThemeViewModel? _defaultTheme; private IDisposable? _themeObservable; private IDisposable? _editorObservable; private ViewModelsSerializer? _serializer; -#pragma warning disable CS0618 [DataMember] - public IReactiveList? Themes + public IList? Themes { get { return _themes; } set { this.RaiseAndSetIfChanged(ref _themes, value); } } -#pragma warning restore CS0618 [IgnoreDataMember] public ThemeViewModel? CurrentTheme @@ -92,9 +89,7 @@ namespace ThemeEditor.ViewModels public void LoadFromJson(string json) { -#pragma warning disable CS0618 - var themes = _serializer?.Deserialize>(json); -#pragma warning restore CS0618 + var themes = _serializer?.Deserialize>(json); Themes = themes; CurrentTheme = themes?.FirstOrDefault(); } @@ -580,9 +575,7 @@ namespace ThemeEditor.ViewModels if (Themes == null) { CurrentTheme = DefaultTheme?.Clone(); -#pragma warning disable CS0618 - Themes = new ReactiveList(); -#pragma warning restore CS0618 + Themes = new ObservableCollection(); if (CurrentTheme != null) { Themes.Add(CurrentTheme);