가 value converter을 하나
=/
좋은 하루 되세요을 =) 찾아 버튼
IsEnabled
에 결합하지 수 있어요 변환기를 사용하여
Listbox
의
SelectedIndex
public class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
int ndx = (int)value;
if (ndx < 0) return false;
return true;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
<Window.Resources>
<my:MyConverter x:Name="MyConverter"/>
</Window.Resources>
<ListBox x:Name="MyListBox"></ListBox>
<Button IsEnabled="{Binding Path=SelectedIndex, ElementName=MyListBox, Converter={StaticResource MyConverter}}"/>
일부 소스 코드는 유용 할 것입니다. –