1
的列表中,我們怎樣才能顯示一個ListBoxItem的提示時,ListBox控件綁定到字符串列表。下面是我的ListBox的源代碼,其中ConcernedConditions是列表類型。工具提示ListBoxItem的當綁定到字符串
<ListBox ItemsSource="{Binding ConcernedConditions}" Style="{StaticResource CustomStyle}">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
哇...這確實是一個很容易解決。謝謝安迪:) – Irfan