MauiTutorial/MauiApp2/ViewModels/AboutViewModel.cs

23 lines
669 B
C#

using CommunityToolkit.Mvvm.Input;
using System.Windows.Input;
namespace MauiApp2.ViewModels
{
internal class AboutViewModel
{
public string Title => AppInfo.Name;
public string Version => AppInfo.VersionString;
public string MoreInfoUrl => "https://aka.ms/maui";
public string Message => "This app is written in XAML and C# with .NET MAUI.";
public ICommand ShowMoreInfoCommand { get; }
public AboutViewModel()
{
ShowMoreInfoCommand = new AsyncRelayCommand(ShowMoreInfo);
}
async Task ShowMoreInfo() =>
await Launcher.Default.OpenAsync(MoreInfoUrl);
}
}