Files
Needlework.Net/Needlework.Net/ViewModels/MainWindow/NotificationViewModel.cs
2025-06-13 22:52:58 -05:00

28 lines
753 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Needlework.Net.Models;
using System.Diagnostics;
namespace Needlework.Net.ViewModels.MainWindow
{
public partial class NotificationViewModel : ObservableObject
{
public NotificationViewModel(Notification notification)
{
Notification = notification;
IsButtonVisible = !string.IsNullOrEmpty(notification.Url);
}
public bool IsButtonVisible { get; }
public Notification Notification { get; }
[RelayCommand]
public void OpenUrl()
{
var process = new Process() { StartInfo = new() { UseShellExecute = true } };
process.Start();
}
}
}