Created
August 14, 2018 21:17
-
-
Save JoeM-RP/09e4b2a22896763f1a1e036449d8da06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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