Using AppBarUtils in MultiLanguage AppBar

Apr 16, 2012 at 1:25 PM


I discovered your dll and think that it's a nice thing. But it has one weakness. Binding to the Text-Property brings some problems.


        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
                <shell:ApplicationBarMenuItem Text="Setup"/>
        <AppBar:AppBarItemCommand  Id="Setup" Text="{Binding Source={StaticResource GlobalResources}, Path=AppBar_Setup}" Type="MenuItem" Command="{Binding Source={StaticResource MyJobTasksViewModel}, Path=NavigateToSetup}" />
        <AppBar:AppBarItemTrigger Type="MenuItem" Id="Setup">
            <AppBar:NavigateWithQueryStringAction TargetPage="/View/SetupView.xaml"/>

The name of my Button is translated to German with the Binding in the Interaction.Behaviors Trigger. So you can't access the Interatcion.Triggers because the ID or the Text in MenuItem has changed. Has anyone a solution for my problem?


Thank you.  

Apr 18, 2012 at 1:54 PM

Hi there,

Looks like you want more than one actions for the same app bar item? In this case, you can put multiple actions inside one AppBarItemTrigger like:

        <AppBar:AppBarItemTrigger Type="MenuItem" Id="Setup" Text="{Binding Source={StaticResource GlobalResources}, Path=AppBar_Setup}">
            <InvokeCommandAction Command="{Binding Source={StaticResource MyJobTasksViewModel}, Path=NavigateToSetup}"/>
            <AppBar:NavigateWithQueryStringAction TargetPage="/View/SetupView.xaml"/>
The trick here is to use InvokeCommandAction provided by Expression Blend SDK instead of AppBarItemCommand, and let AppBarItemTrigger do the Text binding for you.