我有一个 WPF 应用程序。如果我只在按钮单击时编写网格隐藏显示,那么它正在工作。但是如果我在下面写任何代码,它就不起作用。
<Grid Margin="0">
<Grid x:Name="nonLoading" Margin="0" Visibility="{Binding Path=GridVisibility}">
</Grid>
private Visibility _gridVisibility = Visibility.Visible;
public Visibility GridVisibility
{
get
{
return _gridVisibility;
}
set
{
_gridVisibility = value;
}
}
我怎样才能解决这个问题?