我现在有一个标签按钮的新问题。下面的代码将视图绑定到视图模型:
<Label Name="isImageValid" Content="Image not Created" Margin="0,7,1,0" Style="{StaticResource LabelField}"
Grid.ColumnSpan="2" Grid.Row="15" Width="119" Height="28" Grid.RowSpan="2"
Grid.Column="1" IsEnabled="True"
Visibility="{Binding isImageValid}" />
以下是我的 ViewModel 中的代码:
private System.Windows.Visibility _isImageValid;
public System.Windows.Visibility isImageValid
{
get
{
return _isImageValid;
}
set
{
_isImageValid = value;
this.RaisePropertyChanged(() => this.isImageValid);
}
}
private void OnImageResizeCompleted(bool isSuccessful)
{
if (isSuccessful)
{
this.SelectedStory.KeyframeImages = true;
isImageValid = System.Windows.Visibility.Visible;
}
else
{
this.SelectedStory.KeyframeImages = false;
}
}
在调用“OnImageResizeCompleted”之前,该标签应保持隐藏状态,但由于某种原因,该图像始终可见。请问我需要改变什么来隐藏它?