locked
hub control header always "application name" RRS feed

  • Question

  • If you create a hub template app for a universal app and manually set the header, then run the app, the header is "application name." I also tried setting the header via StaticResource, but it still runs with "application name" as the header.

    Michael DiLeo

    • Moved by Jamles Hez Monday, August 25, 2014 2:17 AM
    Wednesday, August 20, 2014 5:39 PM

Answers

  • are you using resource files? try to remove the x:Uid="Hub" I think its reading the title from the resourcefile

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Proposed as answer by mSpot Inc Monday, August 25, 2014 8:39 AM
    • Marked as answer by mcd023 Monday, August 25, 2014 11:42 PM
    Monday, August 25, 2014 6:15 AM

All replies

  • Hi Michael DiLeo,

    You mentioned you manually set the header, how did you do this?

    Below is the Hub Header I copied from Hub Template, did you comment this section when you apply your own header? The bolded line below is the place where you can display the header name.

                <Hub.Header>
                    <!-- Back button and page title -->
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Button  x:Name="backButton" Style="{StaticResource NavigationBackButtonNormalStyle}"
                            Margin="-1,-1,39,0" 
                            VerticalAlignment="Top"
                            Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                            AutomationProperties.Name="Back"
                            AutomationProperties.AutomationId="BackButton"
                            AutomationProperties.ItemType="Navigation Button"/>
                        <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                            VerticalAlignment="Top" IsHitTestVisible="false" TextWrapping="NoWrap" />
                    </Grid>
                </Hub.Header>

    --James

     


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, August 21, 2014 7:04 AM
  • Thank you for the help, James. I've included my code and some screenshots of the designer and the emulator. The application name is set in app.xaml as a resource string. Any ideas as to why this is happening?

    <Hub x:Name="hub" x:Uid="Hub" 
                    Header="{Binding Converter={StaticResource ToLowerConverter}, 
                            Source={StaticResource ApplicationName}}" 
                    Background="{Binding BackgroundImage}"
    			    DataContext="{Binding ViewModel}"
    			    d:DataContext="{Binding}"
    			    Foreground="{Binding ForegroundColor}" 
                    SectionsInViewChanged="hub_SectionsInViewChanged">


    Michael DiLeo

    Sunday, August 24, 2014 9:29 PM
  • Hi Michael,

    Let's say try to set a breakpoint in your ToLowerConverter converter class to see what is the income value and what is output value.

    Anyway, move to Windows Phone forum for a better support.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 25, 2014 2:17 AM
  • are you using resource files? try to remove the x:Uid="Hub" I think its reading the title from the resourcefile

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Proposed as answer by mSpot Inc Monday, August 25, 2014 8:39 AM
    • Marked as answer by mcd023 Monday, August 25, 2014 11:42 PM
    Monday, August 25, 2014 6:15 AM
  • Dave is correct. The Hub (and Pivot) project templates are set up to get strings from the Resources.resw file, as an example of language support.

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/4a7737a8-2354-4165-bc3d-f71493de987d/pivot-app-title-for-windows-phone-81

    Monday, August 25, 2014 8:45 AM