How do I bind the Text property of the aplicatiobbar button.
Both the 2 following lines fails with message> Set property 'Telerik.Windows.Controls.ApplicationBarButton.Text' threw an exception. [Line: 81 Position: 52]
Text
="{Binding Path=Localizedresources.AppBarCapturePhoto,Source={StaticResource LocalizedStrings}}" />
Text
="{Binding ApplicationTitle}" />
They work if i put them on an other control on the page. What am I doing wrong?
Below is xaml for the page.
<
phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:tilt="clr-namespace:MomentumPMMobile.ControlTiltEffect"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:il="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:MyInteractivity="clr-namespace:MomentumPMMobile.Interactivity"
xmlns:local="clr-namespace:MomentumPMMobile.Infrastructure"
xmlns:local2="clr-namespace:MomentumPMMobile.UserControls.View"
xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"
xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
DataContext="{Binding Camera, Source={StaticResource Locator}}"
x:Class="MomentumPMMobile.Views.Camera.CameraView3"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="False"
tilt:TiltEffect.IsTiltEnabled="True"
ApplicationBar="{Binding MainViewApplicationBar}">
<!--LayoutRoot is the root grid where all page content is placed-->
<!--DataContext="{Binding Source={StaticResource SampleDataSource1}}"-->
<Grid x:Name="LayoutRoot">
<Grid.Background>
<ImageBrush ImageSource="/Images/PageBackground.png" Stretch="Fill" />
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="7"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ProgressBar
Foreground="{StaticResource ProgressBarColor}"
IsIndeterminate="{Binding ShowProgressBar}"
Visibility="{Binding ShowProgressBar,Converter={StaticResource BooleanToVisibilityConverters}}"
Grid.Row="0"/>
<!--Pivot Control-->
<controls:Pivot Grid.Row="1" x:Name="CameraPivot" Title="{Binding ApplicationTitle}" SelectedIndex="{Binding SelectedPivotIndex,Mode=TwoWay}">
<!--Pivot item Pictures-->
<!--<controls:PivotItem Header="{Binding Path=Localizedresources.SurveyPictures,Source={StaticResource LocalizedStrings}}"-->
<controls:PivotItem Header="{Binding Path=Localizedresources.AppBarCapturePhoto,Source={StaticResource LocalizedStrings}}"
Margin="24,0,0,0">
<Grid Grid.Row="1">
<ListBox SelectedIndex="{Binding Camera.SelectedListIndex, Mode=TwoWay,Source={StaticResource Locator}}" x:Name="listBox" ItemTemplate="{StaticResource Pictures}" ItemsSource="{Binding CameraPictures}" Margin="8" Background="{x:Null}" >
<Custom:Interaction.Triggers>
<Custom:EventTrigger EventName="MouseEnter">
<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding Camera.ListBoxEnterCommand,Source={StaticResource Locator}}" PassEventArgsToCommand="True"/>
</Custom:EventTrigger>
</Custom:Interaction.Triggers>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu tilt:TiltEffect.IsTiltEnabled="True" IsZoomEnabled="False" >
<toolkit:MenuItem Header="Ta bort bild">
<Custom:Interaction.Triggers>
<Custom:EventTrigger EventName="Click">
<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding Camera.MenuitemCommand,Source={StaticResource Locator}}" CommandParameter="{Binding listbox.SelectedItem}"/>
</Custom:EventTrigger>
</Custom:Interaction.Triggers>
</toolkit:MenuItem>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</ListBox>
<telerikPrimitives:RadWindow x:Name="windowPicture" IsOpen="{Binding IswindowPictureOpen,Mode=TwoWay}" WindowSizeMode="FitToPlacementTarget" IsFullScreen="True" >
<telerikPrimitives:RadWindow.Background>
<ImageBrush ImageSource="/Images/PageBackground.png" Stretch="Uniform" />
</telerikPrimitives:RadWindow.Background>
<telerikPrimitives:RadWindow.ApplicationBarInfo>
<telerikPrimitives:ApplicationBarInfo >
<telerikPrimitives:ApplicationBarButton x:Name="iconButtonCapturePicture" IconUri="/Images/appbar_white.camera.png"
Text="{Binding Path=Localizedresources.AppBarCapturePhoto,Source={StaticResource LocalizedStrings}}" />
<telerikPrimitives:ApplicationBarButton x:Name="iconButtonCancel" IconUri="/Images/appbar.cancel.rest.png"
Text="{Binding ApplicationTitle}" />
<telerikPrimitives:ApplicationBarButton x:Name="iconButtonDelete" IconUri="/Images/appbar.delete.rest.png"
Text="Ta bort" />
<telerikPrimitives:ApplicationBarButton x:Name="iconButtonSave" IconUri="/Images/appbar.save.rest.png"
Text="Spara" />
</telerikPrimitives:ApplicationBarInfo>
</telerikPrimitives:RadWindow.ApplicationBarInfo>
 
 
<Custom:Interaction.Triggers>
<Custom:EventTrigger EventName="WindowClosing">
<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding Camera.CloseRadwindowCommand,Source={StaticResource Locator}}" PassEventArgsToCommand="True"/>
</Custom:EventTrigger>
</Custom:Interaction.Triggers>
<Border BorderThickness="{StaticResource PhoneBorderThickness}" CornerRadius="5" >
<Border.BorderBrush>
<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
</Border.BorderBrush>
<Grid>
<!--<Grid x:Name="MasterDetailGrid" DataContext="{Binding SelectedItem, ElementName=listBox, Mode=TwoWay}" d:DataContext="{Binding CameraPictures[0]}">-->
<Grid x:Name="MasterDetailGrid" DataContext="{Binding Pictureobj, Mode=TwoWay}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Margin="8,0" Text="{Binding CapturedBy}" Height="30" Width="180"/>
<TextBlock Text="{Binding CapturedDate}" Margin="8,0" Grid.Column="1" Height="30"/>
<TextBox Margin="0" Text="{Binding Note,Mode=TwoWay}" Height="140" Grid.Row="2" Grid.ColumnSpan="2" BorderBrush="#BF0C0000">
<i:Interaction.Behaviors>
<MyInteractivity:UpdateTextBindingOnPropertyChanged/>
</i:Interaction.Behaviors>
<Custom:Interaction.Triggers>
<Custom:EventTrigger EventName="GotFocus">
<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding Camera.UpdateChangeCommand,Mode=OneWay,Source={StaticResource Locator}}"/>
</Custom:EventTrigger>
</Custom:Interaction.Triggers>
</TextBox>
<Image Source="{Binding Picture, Converter={StaticResource ByteImageConverter},Mode=TwoWay}" HorizontalAlignment="Stretch" Margin="8,8,8,0" Grid.Row="1" Grid.ColumnSpan="2" Stretch="Fill">
</Image>
<Border BorderBrush="Black" BorderThickness="3" Margin="8,8,8,0" Grid.Row="1" HorizontalAlignment="Stretch" Grid.ColumnSpan="2"/>
</Grid>
</Grid>
</Border>
</telerikPrimitives:RadWindow>
</Grid>
</controls:PivotItem>
</controls:Pivot>
<local2:CustomMessageBox x:Name="DialogControl" Grid.RowSpan="2"/>
</Grid>
<!--Sample code showing usage of ApplicationBar-->
<!--<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
<shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>-->
</
phone:PhoneApplicationPage>