0

我有以下 XAML

<ListBox Name="feedListBox" Height="468" HorizontalAlignment="Left" Margin="20,100,0,0" VerticalAlignment="Top" Width="444" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="feedListBox_SelectionChanged"  DataContext="{Binding Source={StaticResource MyData}}">
   <ListBox.ItemTemplate>
         <DataTemplate>
              <StackPanel VerticalAlignment="Top">
                  <TextBlock TextDecorations="Underline" FontSize="24" Name="feedTitle" TextWrapping="Wrap" Margin="12,0,0,0" HorizontalAlignment="Left" Foreground="{StaticResource PhoneAccentBrush}" Text="{Binding Title.Text, Path=Arabic , Converter={StaticResource RssTextTrimmer}}"  />
                  <TextBlock Name="feedSummary" TextWrapping="Wrap" Margin="12,0,0,0" Text="{Binding Summary.Text, Converter={StaticResource RssTextTrimmer}}"  />
                  <TextBlock Name="feedPubDate" Foreground="{StaticResource PhoneSubtleBrush}" Margin="12,0,0,10" Text="{Binding PublishDate.DateTime}"  />
              </StackPanel>
         </DataTemplate>
   </ListBox.ItemTemplate>
</ListBox>

现在我有这个对象

crAr = new Arabic.Controls.ArabicShape();

我想在 XAML 的每个元素上应用 DisplayArabic 方法,如下所示:

///// FeedTitle TextBlock
{TextBlock ELEMENT content} = crAr.DisplayArabic( {TextBlock ELEMENT content} );

///// FeedSummary TextBlock
{TextBlock ELEMENT content} = crAr.DisplayArabic( {TextBlock ELEMENT content} );

///// FeedPubDate TextBlock
{TextBlock ELEMENT content} = crAr.DisplayArabic( {TextBlock ELEMENT content} );

这怎么可能用 C# 编写?

4

1 回答 1

0

试试这个如何:绑定到方法

于 2012-05-28T03:02:59.730 回答