More Prism stuff
This commit is contained in:
22
Example/MainWindowViewModel.cs
Normal file
22
Example/MainWindowViewModel.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
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; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user