質問

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