This looks so embarrassing and most awful to ask question again and again for the same thing.
Really sorry but i couldn’t still figure it out or not working as expected
in my previous post @slugster suggested converter ,so used his code like below
MyView.xaml
<UserControl.Resources>
<!-- Image Buttons -->
<Converters:BooleanToVisibilityConverter x:Key="visibilityConverter"></Converters:BooleanToVisibilityConverter>
<!--Label-->
<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></Converters:BooleanToVisibilityConverter>
<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,Converter={StaticResource BooleanToVisibilityConverter}}" />
myviewModel.cs
private bool _isImageValid;
public bool IsImageValid
{
get { return _isImageValid; }
set
{
_isImageValid = value;
this.RaisePropertyChanged(() => this.IsImageValid);
}
}
private void OnImageResizeCompleted(bool isSuccessful)
{
if (isSuccessful)
{
this.SelectedStory.KeyframeImages = true;
_isImageValid = false;
// isImageValid = System.Windows.Visibility.Collapsed;
}
else
this.SelectedStory.KeyframeImages = false;
}
when i debug the code,its not even reflect in the UI,when “OnImageResizeCompleted” method called and “_isImageValid=False”.Again am lost now.I know i get lot of negative comments but sorry i couldn’t able to figure it out myself.
First, correct
Visibility="{Binding isImageValid...line. Your view model property isIsImageValid.Second,
OnImageResizeCompleted()method does not notify UI aboutIsImageValidproperty changes, it simply modifies property backing field. Change_isImageValid = falsetoIsImageValid = false.