Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight - Applying Converters within Templates
    primarykey
    data
    text
    <p>I am currently updating the template of a ListPicker. In particular, I'm trying to style the contents of the full mode popup. This information appears to be defined in the following code:</p> <pre><code>&lt;Popup x:Name="FullModePopup"&gt; &lt;Border Background="{StaticResource PhoneChromeBrush}"&gt; &lt;!-- Popup.Child should always be a Border --&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition/&gt; &lt;/Grid.RowDefinitions&gt; &lt;ContentControl Grid.Row="0" Content="{TemplateBinding FullModeHeader}" Foreground="{StaticResource PhoneForegroundBrush}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontSize="{StaticResource PhoneFontSizeNormal}" HorizontalAlignment="Left" Margin="24 12 0 0"/&gt; &lt;ListBox x:Name="FullModeSelector" Grid.Row="1" FontSize="{TemplateBinding FontSize}" Margin="{StaticResource PhoneMargin}"&gt; &lt;ListBox.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;StackPanel/&gt; &lt;!-- Ensures all containers will be available during the Loaded event --&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ListBox.ItemsPanel&gt; &lt;/ListBox&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;/Popup&gt; </code></pre> <p>My challenge is, I need to trim the text of each item bound in this popup list. More importantly, I need to do this with a converter. Is this even possible? How do I use a converter in this template? Traditionally, I've used something like:</p> <pre><code>&lt;TextBlock Text="{Binding Path=Name, Converter={StaticResource myConverter}}" /&gt; </code></pre> <p>How do I apply a Converter to the items in the Popup of my ListPicker?</p> <p>Thank you! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload