Reputation: 5846
I have the follwing listpicker
<toolkit:ListPicker ItemsSource="{Binding title}" Name="titlePicker" ExpansionMode="ExpansionAllowed" Grid.Row="1" Margin="0,-50,50,0" Background="White" Foreground="#FFDA3434" Canvas.ZIndex="10" HorizontalAlignment="Right" FontSize="20" Grid.RowSpan="2"/>
that contains 3 items and i would like them to align right, but for some reason i can't find the option to align the text, what am i missing?
Upvotes: 0
Views: 496
Reputation: 4490
You should do this in the ListPickerItemTemplate. Add Template to the page resources (or app resources)
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Name="ListPickerItemTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Right" Text="{Binding ItemName}"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Name="ListPickerFullModeItemTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Right" Text="{Binding ItemName}"/>
</StackPanel>
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
and assign template to the picker:
<toolkit:ListPicker
ItemTemplate="{StaticResource ListPickerItemTemplate}"
FullModeItemTemplate="{StaticResource ListPickerFullModeItemTemplate}"
...
Upvotes: 1