Skip to content

Commit 4689fc3

Browse files
feat: adding updating dialog during the application update
#6
1 parent f214974 commit 4689fc3

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

src/TwitchStreamingTools/ViewModels/MainWindowViewModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public class MainWindowViewModel : ViewModelBase {
3030
/// </summary>
3131
private bool _isMenuOpen;
3232

33+
/// <summary>
34+
/// True if the application is updating, false otherwise.
35+
/// </summary>
36+
private bool _isUpdating;
37+
3338
/// <summary>
3439
/// The open page.
3540
/// </summary>
@@ -102,6 +107,14 @@ public MenuItem SelectedMenuItem {
102107
set => this.RaiseAndSetIfChanged(ref _selectedMenuItem, value);
103108
}
104109

110+
/// <summary>
111+
/// True if the application is updating, false otherwise.
112+
/// </summary>
113+
public bool IsUpdating {
114+
get => _isUpdating;
115+
set => this.RaiseAndSetIfChanged(ref _isUpdating, value);
116+
}
117+
105118
/// <summary>
106119
/// Links the <see cref="Page" /> showing on the screen with changes to the <see cref="SelectedMenuItem" />.
107120
/// </summary>

src/TwitchStreamingTools/Views/MainWindow.axaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,22 @@
4747
VerticalAlignment="Stretch"
4848
Name="ContentWrapper">
4949
<views:WindowsTitleBar IsSeamless="True" />
50-
<DockPanel Background="Transparent">
50+
<!-- The Application is Currently Updating and Not Usable!: This must come first because the final item always fills. -->
51+
<DockPanel Background="Transparent" DockPanel.Dock="Top" IsVisible="{Binding IsUpdating}">
52+
<StackPanel>
53+
<Label HorizontalAlignment="Center"
54+
VerticalAlignment="Center"
55+
FontSize="32"
56+
FontWeight="Bold"
57+
Foreground="rgb(204, 200, 175)"
58+
Padding="0 50 0 0">
59+
Updating
60+
</Label>
61+
<views:Loading Width="100" Height="100" />
62+
</StackPanel>
63+
</DockPanel>
64+
<!-- The normal application: This must come last because the last item always fills. -->
65+
<DockPanel Background="Transparent" DockPanel.Dock="Top" IsVisible="{Binding !IsUpdating}">
5166
<SplitView IsPaneOpen="{Binding IsMenuOpen}"
5267
CompactPaneLength="55"
5368
OpenPaneLength="150"

0 commit comments

Comments
 (0)