我正在更新一个ListPicker的模板。特别是,我正在尝试样式化完整模式弹出窗口的内容。这些信息似乎在以下代码中定义:
<Popup x:Name="FullModePopup">
<Border Background="{StaticResource PhoneChromeBrush}">
<!-- Popup.Child should always be a Border -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ContentControl Grid.Row="0" Content="{TemplateBinding FullModeHeader}"
Foreground="{StaticResource PhoneForegroundBrush}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"
FontSize="{StaticResource PhoneFontSizeNormal}"
HorizontalAlignment="Left" Margin="24 12 0 0"/>
<ListBox x:Name="FullModeSelector" Grid.Row="1"
FontSize="{TemplateBinding FontSize}"
Margin="{StaticResource PhoneMargin}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
<!-- Ensures all containers will be available during the Loaded event -->
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</Border>
</Popup>
我的挑战是,我需要裁剪此弹出列表中每个项目的文本。 更重要的是,我需要使用转换器完成此操作。 这是否可能? 我该如何在此模板中使用转换器? 传统上,我会使用类似以下内容的东西:
<TextBlock Text="{Binding Path=Name, Converter={StaticResource myConverter}}" />
如何将转换器应用于 ListPicker 弹出窗口中的项目?
谢谢!