FreshMvvm icon indicating copy to clipboard operation
FreshMvvm copied to clipboard

FreshTabbedNavigationContainer title

Open toddams opened this issue 9 years ago • 2 comments

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?

toddams avatar Sep 26 '16 08:09 toddams

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);
        }

    }

hig-dev avatar Nov 10 '16 18:11 hig-dev

How exactly would I use this? COuld you explain how I could use CoreMethods.Push to push this Tabbed Page?

GuyMicciche avatar May 25 '18 19:05 GuyMicciche