'Xamarin.Forms with FreshMVVM. Adding new property to FreshBasePageModel class
My project (Xamarin.Forms with FreshMVVM) contains multiple pages and I need property isBusy. My PageModels inherit from FreshBasePageModel class. I'm looking for a way to extend FreshBasePageModel class to add IsBusy property.
Is there a way to do this? Multiple inheritance is not allowed in C#. Using extension methods i only add methods (not properties).
There is an idea to add a new class (FreshBasePageModelExt) that inherits from the FreshBasePageModel class, and use this new class as a base class for my PageModels, but perhaps there is a more elegant solution.
Solution 1:[1]
Mine looks like this
public class BaseViewModel : FreshBasePageModel
{
public bool IsBusy { get; set; }
public string Title { get; set; }
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Michael O |
