Katteker/Example/MainWindowViewModel.cs
2018-07-31 22:41:26 +02:00

23 lines
667 B
C#

using System.Threading.Tasks;
using System.Windows.Input;
using Prism.Commands;
using Prism.Mvvm;
namespace Example
{
[JetBrains.Annotations.UsedImplicitly]
public class MainWindowViewModel : BindableBase
{
public MainWindowViewModel()
{
UpdateCommand = new DelegateCommand<string>(async x => await UpdateAsync(x).ConfigureAwait(false));
}
private Task UpdateAsync(string startup) =>
bool.TryParse(startup, out var isStartup)
? Katteker.UserInterface.CheckForUpdateAsync(isStartup)
: Task.FromResult(true);
public ICommand UpdateCommand { get; }
}
}