I am new to WPF.
CODE 1:
if (!Dispatcher.CheckAccess())
{
if (ab == "abc")
{
Dispatcher.Invoke( () =>
lab1.Visibility = Visibility.Visible
, DispatcherPriority.Normal);
}
}
here in the above code i just want to change the visibility on Label.
But with multiple changes like this ....
CODE 2 :
if (!Dispatcher.CheckAccess())
{
if (ab == "abc")
{
Dispatcher.Invoke( () =>
lab1.Visibility = Visibility.Visible
lab2.Visibility = Visibility.Hidden
lab3.Visibility = Visibility.Hidden
, DispatcherPriority.Normal);
}
}
its not working , so Can anyone help me out how to Invoke multiple instances ?