CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Xaml.Shared/ViewModel.cs
Go to the documentation of this file.
1#if !XAMARIN && !NETFX_CORE
2//-----------------------------------------------------------------------
3// <copyright file="ViewModel.cs" company="Marimer LLC">
4// Copyright (c) Marimer LLC. All rights reserved.
5// Website: https://cslanet.com
6// </copyright>
7// <summary>Base class used to create ViewModel objects,</summary>
8//-----------------------------------------------------------------------
9#if ANDROID
10namespace Csla.Axml
11#elif IOS
12namespace Csla.Iosui
13#else
14namespace Csla.Xaml
15#endif
16{
23 public class ViewModel<T> : ViewModelBase<T>
24 {
29 public virtual async void SaveAsync(object sender, ExecuteEventArgs e)
30 {
31 await SaveAsync();
32 }
33
38 public virtual void Cancel(object sender, ExecuteEventArgs e)
39 {
40 DoCancel();
41 }
42
47 public virtual void AddNew(object sender, ExecuteEventArgs e)
48 {
49#if ANDROID || IOS
50 BeginAddNew();
51#else
52 DoAddNew();
53#endif
54 }
55
60 public virtual void Remove(object sender, ExecuteEventArgs e)
61 {
62 DoRemove(e.MethodParameter);
63 }
64
69 public virtual void Delete(object sender, ExecuteEventArgs e)
70 {
71 DoDelete();
72 }
73 }
74}
75#endif
Arguments passed to a method invoked by the Execute trigger action.
Base class used to create ViewModel objects that implement their own commands/verbs/actions.
Base class used to create ViewModel objects, with pre-existing verbs for use by InvokeMethod or Invok...
virtual void Remove(object sender, ExecuteEventArgs e)
Removes an item from the Model (if it is a collection).
virtual void Delete(object sender, ExecuteEventArgs e)
Marks the Model for deletion (if it is an editable root object).
virtual async void SaveAsync(object sender, ExecuteEventArgs e)
Saves the Model, first committing changes if ManagedObjectLifetime is true.
virtual void AddNew(object sender, ExecuteEventArgs e)
Adds a new item to the Model (if it is a collection).
virtual void Cancel(object sender, ExecuteEventArgs e)
Cancels changes made to the model if ManagedObjectLifetime is true.