0
イメージ上にマウスが移動したときに、Silverlightのツールチップ内にチェックボックスのリストを表示したいとします。 データは文字列プロパティのリストです。 問題:チェックボックスのテキストの内容が消え、チェックボックスのみが表示されます。 ボックスとそのテキストコンテンツの両方を表示するにはどうすればよいですか?ありがとう。 Silverlightのチェックボックスの一覧のツールチップ
<ToolTipService.ToolTip >
<ToolTip d:DataContext="{d:DesignInstance Type=local:Data}">
<ListBox x:Name="LstTemp">
<!--<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalAlignment" Value="{Binding Input}"/>
</Style>
</ListBox.ItemContainerStyle>-->
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="true" IsEnabled="False" Content="{Binding Input}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ToolTip>
</ToolTipService.ToolTip>
</Image>
</Grid>
が、私は解決策を見つけた
Public Class Data
Public Property Data1 As String
Public Property Data2 As String
Public Property Input As New List(Of String)
End Class
は、あなたが実際に対話することができますツールチップのもので?それは私がそれを覚えている方法ではありません。また、なぜ 'ListBox'で' CheckBox'esを使うのですか? 'ListBox'はインタラクティブなコンテナで、' CheckBox'はインタラクティブなアイテムです。 'ItemsControl'自体は、コンテナがそのアイテムに干渉しないように、より良いでしょう。 – John
XAMLコードのコメントセクションでは、文字列プロパティのリストからテキストを含む項目を取得しますが、チェックボックスは取得しません。チェックボックスセクションでは、チェックボックスは表示されますが、チェックボックスのテキスト(コンテンツ)では写真が表示されません。 –