Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Help in understanding MasterDetailPage Title and Icon

$
0
0

Hello,

I am looking for help in better understanding the Icon and Title property that every page in Xamarin forms seems to have. If I have a simple layout such as this :

public class RootPage : MasterDetailPage
{
    public RootPage ()
    {
        this.Master = new ContentPage () { Title = "This Title Doesn't Show Up?", Icon = "Menu_Icon.png" };
        this.Detail = new NavigationPage (new CarouselPage {
            Children = {
                new ContentPage {Content = new BoxView {Color = new Color (1, 0, 0)}, Title = "Page 1"},
                new ContentPage {Content = new BoxView {Color = new Color (0, 1, 0)}, Title = "Page 2"},
                new ContentPage {Content = new BoxView {Color = new Color (0, 0, 1)}, Title = "Page 3"}
            },
            Title = "Title Here"
        }) { BarBackgroundColor = Color.FromHex ("3898DC"), BarTextColor = Color.White };
    }
}

This is the only layout that I could get to work so that the menu_icon would show up to open/close the menu. Its confusing that the only way to show the title is to set it on the CarouselPage itself? I would assume that setting it on the Navigation page would set the title but it does not.

I also don't understand why I need to set a title for my this.Master especially if it never shows up in the application?

Any guidance or help on understanding on where I should be setting Icons/Titles is useful.

Thanks.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>