-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
155 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/ImeSense.Launchers.Belarus.Avalonia/Models/InformationMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace ImeSense.Launchers.Belarus.Avalonia.Models; | ||
|
||
public record InformationMessage(string Title, string Description); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/ImeSense.Launchers.Belarus.Avalonia/ViewModels/SplashScreenViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Reactive; | ||
|
||
using ImeSense.Launchers.Belarus.Avalonia.Models; | ||
|
||
using ReactiveUI; | ||
using ReactiveUI.Fody.Helpers; | ||
|
||
namespace ImeSense.Launchers.Belarus.Avalonia.ViewModels; | ||
|
||
public class SplashScreenViewModel : ReactiveObject | ||
{ | ||
private readonly CancellationTokenSource _cts = new(); | ||
|
||
public CancellationToken CancellationToken => _cts.Token; | ||
public ReactiveCommand<Unit, Unit> Cancel { get; set; } = null!; | ||
[Reactive] public InformationMessage? InformationMessage { get; set; } | ||
[Reactive] public int Progress { get; set; } = 0; | ||
[Reactive] public int MaxProgress { get; set; } = 3; | ||
|
||
public SplashScreenViewModel() | ||
{ | ||
InformationMessage = new InformationMessage("Title", "Description"); | ||
Cancel = ReactiveCommand.Create(CancelImpl); | ||
} | ||
|
||
private void CancelImpl() | ||
{ | ||
_cts.Cancel(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/ImeSense.Launchers.Belarus.Avalonia/Views/SplashScreenView.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<UserControl | ||
x:Class="ImeSense.Launchers.Belarus.Avalonia.Views.SplashScreenView" | ||
x:DataType="vm:SplashScreenViewModel" | ||
xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:vm="using:ImeSense.Launchers.Belarus.Avalonia.ViewModels" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
mc:Ignorable="d"> | ||
|
||
<Design.DataContext> | ||
<vm:SplashScreenViewModel /> | ||
</Design.DataContext> | ||
|
||
<Border | ||
Padding="30,30,30,0" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Classes="styled"> | ||
<StackPanel> | ||
<TextBlock | ||
Text="{Binding InformationMessage.Title}" | ||
Margin="10" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Classes="styled" | ||
FontSize="28" /> | ||
|
||
<TextBlock | ||
Text="{Binding InformationMessage.Description}" | ||
Margin="10,10" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Classes="styled" | ||
FontSize="20" /> | ||
|
||
<ProgressBar | ||
Value="{Binding Progress}" | ||
Height="10" | ||
Margin="0,5,0,0" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Center" | ||
Foreground="LightGray" | ||
Maximum="{Binding MaxProgress}" | ||
Minimum="0" /> | ||
<Button | ||
Content="{DynamicResource LocalizedStrings.Cancel}" | ||
Command="{Binding Cancel}" | ||
Margin="10" | ||
Padding="10" | ||
HorizontalAlignment="Center" | ||
Classes="styled" | ||
FontSize="20" /> | ||
</StackPanel> | ||
</Border> | ||
|
||
</UserControl> |
10 changes: 10 additions & 0 deletions
10
src/ImeSense.Launchers.Belarus.Avalonia/Views/SplashScreenView.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace ImeSense.Launchers.Belarus.Avalonia.Views; | ||
public partial class SplashScreenView : UserControl | ||
{ | ||
public SplashScreenView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters