Skip to content

Instantly share code, notes, and snippets.

@JoeM-RP
Created August 14, 2018 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeM-RP/09e4b2a22896763f1a1e036449d8da06 to your computer and use it in GitHub Desktop.
Save JoeM-RP/09e4b2a22896763f1a1e036449d8da06 to your computer and use it in GitHub Desktop.
using System;
using Xamarin.Forms;
using Xamvvm;
namespace RxUIForms.ViewModels
{
public class AppShellViewModel : BasePageModelRxUI
{
/// <summary>
/// Sets the detail page of the Master/Detail View
/// </summary>
/// <param name="page">Page.</param>
/// <typeparam name="TPageModel">The 1st type parameter.</typeparam>
public void SetDetail<TPageModel>(IBasePage<TPageModel> page) where TPageModel : class, IBasePageModel
{
var masterDetailPage = this.GetCurrentPage() as MasterDetailPage;
// If we have set a custom Navbar color in AppShell.cs, we need to preserve it
masterDetailPage.Detail = new NavigationPage(page as Page)
{
BarBackgroundColor = Color.FromHex("#87A3BA"),
BarTextColor = Color.White
};
masterDetailPage.IsPresented = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment