Commit d0c20197 authored by Thomas's avatar Thomas
Browse files

Add initialization overlay to hide form region during loading

parent 2a11d8b6
...@@ -166,13 +166,13 @@ ...@@ -166,13 +166,13 @@
</tab> </tab>
</backstage> </backstage>
<contextMenus> <contextMenus>
<!--The Contact context menu to reset trust--> <!--The Contact context menu to reset trust-->
<contextMenu idMso="ContextMenuContactItem"> <contextMenu idMso="ContextMenuContactItem">
<button id="ButtonContextMenuResetContactTrust" <button id="ButtonContextMenuResetContactTrust"
getImage="ButtonContextMenuContactResetTrust_GetImage" getImage="ButtonContextMenuContactResetTrust_GetImage"
getLabel="ButtonContextMenuContactResetTrust_GetLabel" getLabel="ButtonContextMenuContactResetTrust_GetLabel"
onAction="ButtonContextMenuContactResetTrust_Click"/> onAction="ButtonContextMenuContactResetTrust_Click"/>
</contextMenu> </contextMenu>
</contextMenus> </contextMenus>
</customUI> </customUI>
......
...@@ -19,6 +19,7 @@ namespace pEp.UI.ViewModels ...@@ -19,6 +19,7 @@ namespace pEp.UI.ViewModels
private DateTime? _EditDate = null; private DateTime? _EditDate = null;
private string _Explanation = null; private string _Explanation = null;
private bool _IsLoading = false; private bool _IsLoading = false;
private bool _Loaded = false;
private DistributedPolicyEngine.PatchStatus _Status = DistributedPolicyEngine.PatchStatus.Open; private DistributedPolicyEngine.PatchStatus _Status = DistributedPolicyEngine.PatchStatus.Open;
#endregion #endregion
...@@ -80,6 +81,11 @@ namespace pEp.UI.ViewModels ...@@ -80,6 +81,11 @@ namespace pEp.UI.ViewModels
/// Gets or sets whether the screen is loading. /// Gets or sets whether the screen is loading.
/// </summary> /// </summary>
public bool IsLoading { get => this._IsLoading; set => this.SetProperty(ref this._IsLoading, value); } public bool IsLoading { get => this._IsLoading; set => this.SetProperty(ref this._IsLoading, value); }
/// <summary>
/// Gets or sets whether the screen is fully loaded.
/// </summary>
public bool Loaded { get => this._Loaded; set => this.SetProperty(ref this._Loaded, value); }
/// <summary> /// <summary>
/// Gets whether the OK button is visible. /// Gets whether the OK button is visible.
...@@ -166,6 +172,7 @@ namespace pEp.UI.ViewModels ...@@ -166,6 +172,7 @@ namespace pEp.UI.ViewModels
this.IsRejectButtonVisible = true; this.IsRejectButtonVisible = true;
this.OKButtonText = "Support"; this.OKButtonText = "Support";
this.UpdateView(status); this.UpdateView(status);
this.Loaded = true;
} }
#endregion #endregion
......
...@@ -41,6 +41,17 @@ ...@@ -41,6 +41,17 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!--Hides all other content while the form region is being loaded-->
<Rectangle Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="0"
Grid.RowSpan="8"
Grid.ZIndex="1000"
Fill="White"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Visibility="{Binding Loaded, Converter={StaticResource InvertBoolToVisibility}}" />
<!--Overlay during API calls-->
<Rectangle Grid.Column="0" <Rectangle Grid.Column="0"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="0" Grid.Row="0"
...@@ -51,6 +62,7 @@ ...@@ -51,6 +62,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}" /> Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}" />
<!--Loading animation during API calls-->
<Image Grid.Column="0" <Image Grid.Column="0"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="0" Grid.Row="0"
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!--Overlay during API calls-->
<Rectangle Grid.Column="0" <Rectangle Grid.Column="0"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="0" Grid.Row="0"
...@@ -44,6 +45,7 @@ ...@@ -44,6 +45,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}" /> Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}" />
<!--Loading animation during API calls-->
<Image Grid.Column="0" <Image Grid.Column="0"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Grid.Row="0" Grid.Row="0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment