diff --git a/Source/Csla.Blazor/ViewModel.cs b/Source/Csla.Blazor/ViewModel.cs
index 45476d106a..7005d2621e 100644
--- a/Source/Csla.Blazor/ViewModel.cs
+++ b/Source/Csla.Blazor/ViewModel.cs
@@ -6,405 +6,38 @@
// Base type for creating your own view model
//-----------------------------------------------------------------------
-using System.Collections.Specialized;
-using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using Csla.Core;
using Csla.Reflection;
-using Csla.Rules;
namespace Csla.Blazor
{
///
/// Base type for creating your own view model.
///
- public class ViewModel
+ public class ViewModel<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T> : Csla.Mvvm.ViewModel
{
- ///
- /// Gets the current ApplicationContext instance.
- ///
- protected ApplicationContext ApplicationContext { get; }
-
///
/// Creates an instance of the type.
///
///
/// is .
public ViewModel(ApplicationContext applicationContext)
- {
- ApplicationContext = applicationContext ?? throw new ArgumentNullException(nameof(applicationContext));
- }
-
- #region Events
-
- ///
- /// Event raised after Model has been saved.
- ///
- public event Action? Saved;
- ///
- /// Event raised when failed to save Model.
- ///
- public event EventHandler? Error;
- ///
- /// Event raised when Model is changing.
- ///
- public event Action? ModelChanging;
- ///
- /// Event raised when Model has changed.
- ///
- public event Action? ModelChanged;
- ///
- /// Event raised when the Model object
- /// raises its PropertyChanged event.
- ///
- public event PropertyChangedEventHandler? ModelPropertyChanged;
- ///
- /// Event raised when the Model object
- /// raises its ModelChildChanged event.
- ///
- public event Action