It is necessary to make the button visible only if the element with index 1 is selected in TabControl. I try to do it through the converter, but it does not work.
<Button.Visibility> <Binding ElementName="mainTab" Converter="{StaticResource BackButtonVisibleConverter}" UpdateSourceTrigger="PropertyChanged"> </Binding> </Button.Visibility> Converter
public class BackButtonVisibleConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { TabControl tab = value as TabControl; if (tab.SelectedIndex == 1) return Visibility.Visible; return Visibility.Hidden; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } }
BackButtonVisibleConverter? - Dmitry Chistik