5
votes

I'm implementing a Master Detail navigation using Xamarin Forms (v2.3.1.114) and FreshMVVM where the first page is a tabbed navigation. For the implementation, I'm using FreshMVVM custom Navigation Sample.

The navigation works fine on Android and iOS but on UWP the Master Navigation Button doesn't show up.

Android vs UWP enter image description here

Here is a part of my navigation code

FreshTabbedNavigationContainer _mainTabs;
void Setup()
    {
        _mainTabs = new FreshTabbedNavigationContainer();
        _mainTabs.AddTab<MyRewardsPageModel>("My Rewards", null);
        _mainTabs.AddTab<MapPageModel>("Map", null);
        _mainTabs.AddTab<NearbyPageModel>("Near You", null);
        _contactusPage = FreshPageModelResolver.ResolvePageModel<ContactUsPageModel>();
        _aboutUsPage = FreshPageModelResolver.ResolvePageModel<AboutUsPageModel>();
    }

void CreateMenuPage(string menu)
    {
        var menuPage = new ContentPage { Title = menu };
        var listView = new ListView { ItemsSource = new string[] { "Home", "Contact Us", "About Us" } };
        listView.ItemSelected += (sender, args) =>
        {
            switch ((string)args.SelectedItem)
            {
                case "Home":
                    Detail = _mainTabs;
                    break;
                case "Contact Us":
                    Detail = new NavigationPage(_contactusPage);
                    break;
                case "About Us":
                    Detail = new NavigationPage(_contactusPage);
                    break;
                default:
                    break;
            }
            IsPresented = false;
        };
        IsPresented = true;
        menuPage.Content = listView;
        Detail = _mainTabs;
        Master = new NavigationPage(menuPage)
        {
            Title = menu,
            BarBackgroundColor = Color.Green,
            BarTextColor = Color.Black
        };
    }

Is this a Xamarin Forms bug or is it my implementation? Any suggestion is highly appreciated

1
I downloaded FreshMvvm sample, and the master/detail page works fine by my side, have you test that sample? I can't find any problem in your code. What is your xamarin version and your UWP target sdk version? - Grace Feng
I tried Xamarin Forms v2.3.0.107 and v2.3.1.114 but still the navigation button is hidden. My UWP target version is Windows 10 anniversary Edition (10.0; Build 14393) - Elias Nawfal
@GraceFeng-MSFT It looks like this v2.0.1.6505 of XF doesn't have this bug, thank you for pointing this out. - Elias Nawfal
@GraceFeng-MSFT but I am still looking for a workaround as downgrading to an older XF is not the best solution. Do you have any other suggestion? - Elias Nawfal
Hi Elias, have you tried my answer? - Franklin Chen - MSFT

1 Answers

2
votes

Is this a Xamarin Forms bug or is it my implementation

It's not a Xamarin bug, actually, the icon images are missing in UWP project.

The image resources are included in Android project:

enter image description here

Add these images to UWP project:

enter image description here

The screenshot:

enter image description here