>Hi,
>
>I have a delete button on a WPF form which I only want enabled whenever one and only one item is selected in a grid on the same form. I figure I have to do something like this:
>
>IsEnabled="{Binding ElementName=grdManifest, Path=Items.Selected.Count = 1}"
>
>but that isn't accepted as valid code.
>
>Any ideas on how to do this?
Implement an IValueConverter (
http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter%28v=vs.110%29.aspx) to convert your int value (the count) to a bool. Since its a one way binding, you don't need to implement ConvertBack, just throw a NotImplementedException.