mirror of
https://github.com/frosch95/K8sFileBrowser.git
synced 2026-04-11 12:58:22 +02:00
show message also in ui thread
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
<ApplicationIcon>Assets/app.ico</ApplicationIcon>
|
||||
<Version>0.0.9</Version>
|
||||
<Version>0.1.1</Version>
|
||||
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
|
||||
@@ -386,6 +386,11 @@ public class MainWindowViewModel : ViewModelBase
|
||||
#region show messages
|
||||
|
||||
private void ShowWorkingMessage(string message)
|
||||
{
|
||||
RxApp.MainThreadScheduler.Schedule(Action);
|
||||
return;
|
||||
|
||||
void Action()
|
||||
{
|
||||
Message = new Message
|
||||
{
|
||||
@@ -394,17 +399,19 @@ public class MainWindowViewModel : ViewModelBase
|
||||
IsError = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowErrorMessage(string message)
|
||||
{
|
||||
RxApp.MainThreadScheduler.Schedule(Action);
|
||||
return;
|
||||
|
||||
async void Action()
|
||||
{
|
||||
Message = new Message { IsVisible = true, Text = message, IsError = true };
|
||||
await Task.Delay(7000);
|
||||
HideWorkingMessage();
|
||||
}
|
||||
|
||||
RxApp.MainThreadScheduler.Schedule(Action);
|
||||
}
|
||||
|
||||
private void ShowErrorMessage(Exception exception)
|
||||
|
||||
Reference in New Issue
Block a user