FreshMvvm
FreshMvvm copied to clipboard
FreshTabbedNavigationContainer title
Is it possible to set a global title for the FreshTabbedNavigationContainer, so when I swith to another tab - title stays the same? And also is it possible to have a viewmodel for the container?
Yes and yes. Use FreshTabbedFONavigationContainer:
Example: Your main page xaml:
<?xml version="1.0" encoding="utf-8" ?>
<FreshTabbedFONavigationContainer xmlns="clr-namespace:FreshMvvm;assembly=FreshMvvm"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:YourApp"
x:Class="YourApp.MainPage"
xmlns:viewModels="clr-namespace:YourApp.ViewModels">
<FreshTabbedFONavigationContainer.BindingContext>
<viewModels:MainPageViewModel></viewModels:MainPageViewModel>
</FreshTabbedFONavigationContainer.BindingContext>
</FreshTabbedFONavigationContainer>
Your page class:
public partial class MainPage : FreshMvvm.FreshTabbedFONavigationContainer
{
public MainPage(string titleOfFirstTab) : base(titleOfFirstTab)
{
InitializeComponent();
}
}
Your ViewModel:
public class MainPageViewModel : FreshBasePageModel
{
public override async void Init(object initData)
{
base.Init(initData);
}
protected override void ViewIsAppearing(object sender,EventArgs e)
{
base.ViewIsAppearing(sender,e);
}
}
How exactly would I use this? COuld you explain how I could use CoreMethods.Push to push this Tabbed Page?