How to add title text view in MasterDetailsView

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

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. Fay Wang - MSFT 5,191 Reputation points
    2020-07-21T01:39:23.113+00:00

    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>
    
    0 comments No comments