5

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

Elias Nawfal
  • 128
  • 9
  • 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 Sep 02 '16 at 09:51
  • 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 Sep 03 '16 at 05:44
  • @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 Sep 03 '16 at 06:14
  • @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 Sep 03 '16 at 06:31
  • Hi Elias, have you tried my answer? – Franklin Chen - MSFT Sep 25 '16 at 08:43
  • Hello Franklin, yes I tried but it didn't work. The thing is that if I try a regular page as child of Master Detail Navigation the icon shows up which conclude that the icon is not missing. The problem is when a Tabbed Navigation is child of Master Detail Navigation the icon disappears. Moreover the problem is only present in newer Xamarin Forms versions, as an example Xamarin Forms v2.0.1.6505 is last version that does not have this problem. Thank you for your time and help. Still didn't find a solution and searching @FranklinChen-MSFT – Elias Nawfal Sep 25 '16 at 08:54
  • @EliasNawfal Okay, if possible, could you share your demo with us? I need to check your project to see if this is xamarin issue. Or you can directly report this issue in [here](https://bugzilla.xamarin.com/) . See also [Bug Writing Guidelines](https://bugzilla.xamarin.com/page.cgi?id=bug-writing.html) – Franklin Chen - MSFT Sep 25 '16 at 09:31

1 Answers1

2

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

Franklin Chen - MSFT
  • 4,845
  • 2
  • 17
  • 28