我正在实现 PropertyChangedEventHandler PropertyChanged,它始终为空。属性字符串是正确的donno这里的问题是我正在使用的代码
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
public bool _playerGridVisibility ;
public bool PlayerGridVisibility
{
get { return _playerGridVisibility; }
set
{
_playerGridVisibility = value;
this.OnPropertyChanged(Strings.PlayerGridVisibilityString);
}
并在 xaml
Visibility="{Binding Path=AdsGridVisibility, Converter={StaticResource VC}}"
}
所以有人能知道这个问题吗?