I am having problems with visibility of the spinner control. The control itself works... If I set it to visible right after Initialize it shows and animates as expected.
But if I try to show it from the code it never gets drawn...
the .cs file (presenter)
private void SaveDocument(Document aDocument)
{
if (AllowFlag != null)
{
this.View.ShowDocumentProgressSpinner(true);
this.Save(aDocument);
this.View.ShowDocumentProgressSpinner(false);
}
}
the xaml.cs file
void IDocumentView.ShowDocumentProgressSpinner(bool show)
{
if (show)
{
this.DocumentProgressSpinner.Visibility = Visibility.Visible;
}
else
{
this.DocumentProgressSpinner.Visibility = Visibility.Hidden;
}
}
If i set the visibility to visible right after initialize the spinner works!
part of the xaml of the main control (the spinner is custom control)
...
<Viewbox Grid.Row="3" Width="30" Height="30"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<my:DocumentProgressSpinnerView x:Name="DocumentProgressSpinner" />
...
Probably another threading problem, but I have also tried:
Thread.CurrentThread == Dispatcher.CurrentDispatcher.Thread
TRUE
Dispatcher.FromThread(Thread.CurrentThread).CheckAccess()
TRUE
The control gets invoked, because the "windows spinner" gets activated, just the control never gets shown...