2012-02-13 17 views

答えて

2

あなたは直接BooleanToVisibilityConverterを使用してVisibilityを結合することによって、またはDataTriggerを採用することにより、いずれか、アイテムのIsSelectedに特異的に結合することができます。

  1. 直接結合

    <ListBox.Resources> 
        <BooleanToVisibilityConverter x:Key="b2v"/> 
    </ListBox.Resources> 
    
    <ListBox.ItemTemplate> 
        <DataTemplate> 
         <!-- ... --> 
         <Button Visibility="{Binding IsSelected, 
                RelativeSource={RelativeSource AncestorType=ListBoxItem}, 
                Converter={StaticResource b2v}}".../> 
        </DataTemplate> 
    </ListBox.ItemTemplate> 
    
  2. スタイル& DataTrigger

    throw new NotImplementedException(); 
    
関連する問題