3
我目前正在更新ListPicker的模板。特別是,我試圖設計完整模式彈出窗口的內容。此信息顯示在下面的代碼中定義:Silverlight - 在模板中應用轉換器
<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的Popup中的項目?
謝謝!
哇!非常感謝! – user609886