wpf binding to element

Viewed 31133

Well i guess it's easy my scenario is having 2 elements: ListBox and Button:

<ListBox Name="BannedItemsListBox"
         Margin="5"
         MinWidth="100"
         MaxWidth="100" " Height="
         204" ItemsSource="{Binding Path=BannedItems, Mode=TwoWay}"></ListBox>
<Button Name="RemoveBannedItemsButton"
        Margin="5"
        MinWidth="65"
        Height="22"
        Click="RemoveBannedItemButton_Click">Remove</Button>

I want to bind the IsEnabled property button to be true only if Item from ListBox is selected (focused) in XAML

I tried

IsEnabled="{Binding ElementName=BannedSourcesListBox, Path=TouchesDirectlyOver.Count}"

but no go.

2 Answers
Related