question

ApptacularApps-8305 avatar image
0 Votes"
ApptacularApps-8305 asked RoyLi-MSFT commented

How to add title text view in MasterDetailsView

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




windows-uwp
md-copy.png (34.6 KiB)
md.png (28.7 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, haven't heard from you for a long time, have you solved your issue?

0 Votes 0 ·

I hope you've been well. Is the answer helpful to you? If it solves your issue, you could accept it as an answer.

0 Votes 0 ·

1 Answer

FayWang-MSFT avatar image
0 Votes"
FayWang-MSFT answered

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>


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.