diff --git a/Applications/Editor/Main/Sources/Presenters/DialogViewModel.cs b/Applications/Editor/Main/Sources/Presenters/DialogViewModel.cs index 66b4f2945..aeca015c6 100644 --- a/Applications/Editor/Main/Sources/Presenters/DialogViewModel.cs +++ b/Applications/Editor/Main/Sources/Presenters/DialogViewModel.cs @@ -16,9 +16,8 @@ // along with this program. If not, see . // /* ------------------------------------------------------------------------- */ -using Cube.Xui; -using System; using System.Threading; +using Cube.Xui; namespace Cube.Pdf.Editor { @@ -31,7 +30,7 @@ namespace Cube.Pdf.Editor /// /// /* --------------------------------------------------------------------- */ - public abstract class DialogViewModel : GenericViewModel + public abstract class DialogViewModel : ViewModelBase { #region Constructors @@ -54,7 +53,7 @@ protected DialogViewModel(TModel model, SynchronizationContext context ) : base(model, aggregator, context) { - _dispose = Locale.Subscribe(e => Refresh(nameof(Title))); + Use(Locale.Subscribe(e => Refresh(nameof(Title)))); } #endregion @@ -117,31 +116,6 @@ SynchronizationContext context /* ----------------------------------------------------------------- */ protected abstract string GetTitle(); - /* ----------------------------------------------------------------- */ - /// - /// Dispose - /// - /// - /// Releases the unmanaged resources used by the object and - /// optionally releases the managed resources. - /// - /// - /// - /// true to release both managed and unmanaged resources; - /// false to release only unmanaged resources. - /// - /// - /* ----------------------------------------------------------------- */ - protected override void Dispose(bool disposing) - { - try { if (disposing) _dispose.Dispose(); } - finally { base.Dispose(disposing); } - } - - #endregion - - #region Fields - private readonly IDisposable _dispose; #endregion } } diff --git a/Applications/Editor/Main/Sources/Presenters/Insert/PositionViewModel.cs b/Applications/Editor/Main/Sources/Presenters/Insert/PositionViewModel.cs index a9b4ca002..977c12c52 100644 --- a/Applications/Editor/Main/Sources/Presenters/Insert/PositionViewModel.cs +++ b/Applications/Editor/Main/Sources/Presenters/Insert/PositionViewModel.cs @@ -30,7 +30,7 @@ namespace Cube.Pdf.Editor /// /// /* --------------------------------------------------------------------- */ - public sealed class PositionViewModel : GenericViewModel + public sealed class PositionViewModel : ViewModelBase { #region Constructors diff --git a/Applications/Editor/Main/Sources/Presenters/Main/MainViewModelBase.cs b/Applications/Editor/Main/Sources/Presenters/Main/MainViewModelBase.cs index 93f339994..de40f7ed1 100644 --- a/Applications/Editor/Main/Sources/Presenters/Main/MainViewModelBase.cs +++ b/Applications/Editor/Main/Sources/Presenters/Main/MainViewModelBase.cs @@ -39,7 +39,7 @@ namespace Cube.Pdf.Editor /// /// /* --------------------------------------------------------------------- */ - public abstract class MainViewModelBase : GenericViewModel + public abstract class MainViewModelBase : ViewModelBase { #region Constructors diff --git a/Applications/Editor/Main/Sources/Presenters/Main/RecentViewModel.cs b/Applications/Editor/Main/Sources/Presenters/Main/RecentViewModel.cs index 01512ca1d..6b6d6745a 100644 --- a/Applications/Editor/Main/Sources/Presenters/Main/RecentViewModel.cs +++ b/Applications/Editor/Main/Sources/Presenters/Main/RecentViewModel.cs @@ -33,7 +33,7 @@ namespace Cube.Pdf.Editor /// /// /* --------------------------------------------------------------------- */ - public sealed class RecentViewModel : GenericViewModel + public sealed class RecentViewModel : ViewModelBase { #region Constructors diff --git a/Applications/Editor/Main/Sources/Presenters/GenericViewModel.cs b/Applications/Editor/Main/Sources/Presenters/ViewModelBase.cs similarity index 96% rename from Applications/Editor/Main/Sources/Presenters/GenericViewModel.cs rename to Applications/Editor/Main/Sources/Presenters/ViewModelBase.cs index 9cbdfe007..320dec158 100644 --- a/Applications/Editor/Main/Sources/Presenters/GenericViewModel.cs +++ b/Applications/Editor/Main/Sources/Presenters/ViewModelBase.cs @@ -16,7 +16,6 @@ // along with this program. If not, see . // /* ------------------------------------------------------------------------- */ -using Cube.Xui; using System; using System.Collections.Concurrent; using System.Diagnostics; @@ -24,19 +23,20 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Windows.Input; +using Cube.Xui; namespace Cube.Pdf.Editor { /* --------------------------------------------------------------------- */ /// - /// GenericViewModel(TModel) + /// ViewModelBase(TModel) /// /// /// Represents the base class of ViewModels. /// /// /* --------------------------------------------------------------------- */ - public abstract class GenericViewModel : Presentable + public abstract class ViewModelBase : Presentable { #region Constructors @@ -54,7 +54,7 @@ public abstract class GenericViewModel : Presentable /// Synchronization context. /// /* ----------------------------------------------------------------- */ - protected GenericViewModel(TModel model, Aggregator aggregator, SynchronizationContext context) : + protected ViewModelBase(TModel model, Aggregator aggregator, SynchronizationContext context) : base(model, aggregator, context) { } #endregion