I have a DispatcherTimer
in my UWP app for updating database from a web services.
public DispatcherTimer SessionTimer { get; set; }
Before updating the DB in the tick event of this timer, I collapse main grid and show updating message and after update completed I do reverse.
private void SessionTimer_Tick(object sender, object e)
{
rpWait.Visibility = Visibility.Visible;
LayoutRoot.Visibility = Visibility.Collapsed;
Update();
rpWait.Visibility = Visibility.Collapsed;
LayoutRoot.Visibility = Visibility.Visible;
}
My XAML codes:
<Grid x:Name="LayoutRoot" Style="{StaticResource backGrid}">
<RelativePanel Style="{StaticResource rpTop}">
...
</RelativePanel>
<Frame x:Name="frameBody" Loaded="frameBody_Loaded" Margin="0,100,0,0"/>
</Grid>
<RelativePanel x:Name="rpWait" Visibility="Collapsed">
<StackPanel RelativePanel.AlignHorizontalCenterWithPanel="True" RelativePanel.AlignVerticalCenterWithPanel="True">
<TextBlock x:Name="lbMessage" FontSize="30" HorizontalAlignment="Center">Updating</TextBlock>
<TextBlock x:Name="lbWaiting" FontSize="30" Margin="0 50 0 0">Please Wait</TextBlock>
</StackPanel>
</RelativePanel>
But the timer does not show anything (DB updated properly).
Help me please?