The XAML code is as follows:
<Helper:BooleanVisibilityValueConverter x:Key="BoolToVisible" />
<Control x:Name="ResizeDecorator" MouseMove="ResizeDecorator_MouseMove" Template=" {StaticResource ResizeDecoratorTemplate}" Visibility="{Binding IsButtonVisible,Converter= {StaticResource ResourceKey=BoolToVisible},RelativeSource={RelativeSource TemplatedParent}}" />
<Helper:BooleanVisibilityValueConverter x:Key="BoolToVisible" />
<Control x:Name="ResizeDecorator" MouseMove="ResizeDecorator_MouseMove" Template="{StaticResource ResizeDecoratorTemplate}" Visibility="{Binding IsButtonVisible,Converter={StaticResource ResourceKey=BoolToVisible},RelativeSource={RelativeSource TemplatedParent}}" />
The ViewModel code:
private bool _IsButtonVisible;
public bool IsButtonVisible
{
get { return _IsButtonVisible; }
set
{
_IsButtonVisible = value;
NotifyPropertyChanged("IsButtonVisible");
}
}
IsButtonVisible =false;
Can anyone tell me where am I going wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…