37 lines
988 B
C#
37 lines
988 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using WinWARP.Core.Services.Interfaces;
|
|
|
|
|
|
namespace WinWARP.Core.ViewModels.Dialogs;
|
|
|
|
public partial class AddSubscriptionViewModel(ISubscriptionFetcher subscriptionFetcher, ILocalizationService localizationService) : ObservableObject
|
|
{
|
|
private readonly ISubscriptionFetcher _subscriptionFetcher = subscriptionFetcher;
|
|
private readonly ILocalizationService _localizationService = localizationService;
|
|
|
|
[ObservableProperty]
|
|
[NotifyPropertyChangedFor(nameof(CanSubmit))]
|
|
public partial string SubscriptionLink
|
|
{
|
|
get;
|
|
set;
|
|
} = string.Empty;
|
|
|
|
[ObservableProperty]
|
|
public partial string CustomName
|
|
{
|
|
get; set;
|
|
} = string.Empty;
|
|
|
|
[ObservableProperty]
|
|
public partial int UpdateInterval
|
|
{
|
|
get; set;
|
|
} = 0;
|
|
|
|
public bool CanSubmit => _subscriptionFetcher.IsUrlValid(SubscriptionLink);
|
|
}
|