Visibility="{Binding Path=Show, Converter={cnv:BoolToVisibilityConverter}, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ctl:MyControl}}}"
public bool Show { get { return (bool)GetValue(ShowProperty); } set { SetValue(ShowProperty, value); } } public static readonly DependencyProperty ShowProperty = DependencyProperty.Register ( "Show", typeof(bool), typeof(MyControl), new PropertyMetadata(OnShowChanged)); private static void OnShowChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { //Pseudo theControl.Visibility = (bool)e.NewValue; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)