33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
using YouTubeViewers.WPF.Commands;
|
|
using YouTubeViewers.Domain.Models;
|
|
using YouTubeViewers.WPF.Stores;
|
|
|
|
namespace YouTubeViewers.WPF.ViewModels;
|
|
|
|
public class EditYouTubeViewerViewModel : ViewModelBase
|
|
{
|
|
public Guid YouTubeViewerId { get; }
|
|
|
|
public YouTubeViewerDetailsFormViewModel YouTubeViewerDetailsFormViewModel { get; }
|
|
|
|
public EditYouTubeViewerViewModel(YouTubeViewer youTubeViewer, YouTubeViewersStore _youTubeViewersStore, ModalNavigationStore modalNavigationStore)
|
|
{
|
|
YouTubeViewerId = youTubeViewer.Id;
|
|
|
|
ICommand submitCommand = new EditYouTubeViewerCommand(this, _youTubeViewersStore, modalNavigationStore);
|
|
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
|
|
YouTubeViewerDetailsFormViewModel = new YouTubeViewerDetailsFormViewModel(submitCommand, cancelCommand)
|
|
{
|
|
UserName = youTubeViewer.Username,
|
|
IsSubScribed = youTubeViewer.IsSubscribed,
|
|
IsMember = youTubeViewer.IsMember
|
|
};
|
|
}
|
|
}
|