How to add title text view in MasterDetailsView

asked 2020-07-20T18:25:47.163+00:00
Apptacular Apps 386 Reputation points

Is there a way to add a text view above the list in the master page of a MasterDetailsView? I can't seem to find any components allowing me to do this

Expected result

13038-md-copy.png

Current result

12995-md.png

XAML

https://pastebin.com/yAEJ6BaV

Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2020-07-21T01:39:23.113+00:00
    Fay Wang - MSFT 5,121 Reputation points

    Hello,

    Welcome to Microsoft Q&A!

    For MasterDetailsView, it has MasterHeader property which can set the content for the master pane's header, and then you can override the MasterHeaderTemplate to reset the appearance of the header's content. For example:

    .xaml:

    <controls:MasterDetailsView
                   x:Name="MyMasterDetailsView"
                   BackButtonBehavior="Automatic"
                   CompactModeThresholdWidth="720"
                   ItemsSource="{x:Bind Emails}"
                   NoSelectionContent="Select an item to view"
                   MasterHeader="Inbox">
    
        <controls:MasterDetailsView.MasterHeaderTemplate>
            <DataTemplate>
                <StackPanel>
                    <TextBlock FontSize="40" Text="{Binding}"></TextBlock>
                </StackPanel>
            </DataTemplate>
        </controls:MasterDetailsView.MasterHeaderTemplate>
    
        ......
    </controls:MasterDetailsView>
    
    No comments