문제

I am a newbie at Windows Phone 8 developing.

As long as it may look like a silly question, I read around how to change the font size of the panorama title and actually failed at getting it done on my new project.

They all say to just apply this template, modifying the standard one:

 <application.resources>
                <datatemplate x:key="SmallPanoramaTitle">
                    <contentpresenter>
                        <textblock text="{Binding}" fontsize="50" margin="0,70,0,0" />
                    </contentpresenter>
                </datatemplate>
    </application.resources> 

How can I actually do that? Thanks in advance!

도움이 되었습니까?

해결책

I have a blog post detailing how to change the default template for the Panorama control: Changing the background for panorama title and panorama header.

Did you apply the template from your post to the target panorama control? You can do that with the following code:

<Panorama TitleTemplate="{StaticResource SmallPanoramaTitle}">

다른 팁

if your actual question was "where to put this template"? it should be in App.xaml as it contains Application.Resources tag which belongs to App.xaml :

<Application ...>
    ....
    <Application.Resources>
        ....
        <!-- Other resources if any -->
        ....
        <DataTemplate x:Key="SmallPanoramaTitle">
            <ContentPresenter>
                <TextBlock Text="{Binding}" FontSize="50" Margin="0,70,0,0" />
            </ContentPresenter>
        </DataTemplate>
    </Application.Resources>
    ....
</Application>

After that you can use the template in the way shown by @ToniPetrina.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top