listBoxに観察可能なコレクションをバインドします。私は、リストボックスのアイテムにデータのテンションを持っています。 1つのイメージコントロールとsom textBlockを受け取ります。Mouserが上のときに "ポップアップウィンドウ"を表示リストボックスの項目
- 表示ポップアップ/ツールヒント(コントロールでいくつかの「長方形」)とはlistBox現在の項目から値をバインド:マウスは、いくつかのリストボックス項目に終わった場合
私は、この動作を実現したいと思います。
- 私はスタイルデータアイテムテンプレートのtextBoxに、textBlockのテキストの色を黒から緑に変更したいと思います。
スタイルはここにある:私の英語のための
<Style x:Key="FriedNickStyle" TargetType="TextBlock">
<Setter Property="Margin" Value="2,2,2,2"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
Sory、私は、この動作は正しい記述方法に問題があります。私は多くのことを試していますが、どれもうまくいきません。
<DataTemplate x:Key="FriendListBoxItemTemplate">
<Grid Name="RootLayout">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
<Image Margin="4,4,4,2" Grid.Column="0">
<Image.Source >
<MultiBinding Converter="{StaticResource avatarConverter}">
<Binding Path="ProfilePhoto"></Binding>
<Binding Path="StatusInfo.IsLogged"></Binding>
</MultiBinding>
</Image.Source>
</Image>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock
Text="{Binding Path=Nick}"
Style="{StaticResource FriedNickStyle}"
Grid.Column="0" Grid.Row="0">
</TextBlock>
</Grid>
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<!--SHOW SOME POP UP WINDOW and bind properties from ITEM (VALUE)-->
<!--Change color of textBlock-->
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
が私を助けて皆ありがとう:
ここでは私のスタイルです。
はあなたがグーグルを求めている: 基本的には、ここにどのようにですか? – BlackBear
ソーリー、finnaly私は答え、それは動作しますが、それは良い解決策なら私はしません。 –