Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
BaseContentView.cs
2
4{
5 public abstract class BaseContentView : ContentView
6 {
7 public static T Create<T>() where T : BaseContentView
8 {
9 return ServiceHelper.GetService<T>();
10 }
11
16 {
17 set => this.BindingContext = value;
18 get => this.ViewModel<BaseViewModel>();
19 }
20
24 public T ViewModel<T>() where T : BaseViewModel
25 {
26 if (this.BindingContext is T ViewModel)
27 return ViewModel;
28
29 throw new ArgumentException("Wrong view model type: " + typeof(T).FullName);
30 }
31
32 public BaseContentView()
33 {
34 }
35 }
36}
BaseViewModel ContentViewModel
Convenience property for accessing the BindableObject.BindingContext property as a view model.
T ViewModel< T >()
Convenience function for accessing the BindableObject.BindingContext property as a view model.
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...