Building the ExtendedContentPage
Add a new folder called UI
inside the FileStorage
project, add in a new file called ExtendedContentPage.cs
, and implement the following:
public class ExtendedContentPage : ContentPage { #region Private Properties private ViewModelBase _model; #endregion #region Constructors public ExtendedContentPage(ViewModelBase model) { _model = model; _model.Alert -= HandleAlert; _model.Alert += HandleAlert; } #endregion #region Private Methods private async void HandleAlert(object sender, string message) { await DisplayAlert("FileStorage", message, "OK"); } #endregion }
The _model
property is used to reference the view-model of each page as every view-model inherits the ViewModelBase
class. When the page is created, we register ...
Get Xamarin Blueprints now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.