initial load
This commit is contained in:
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace YouTubeViewers.WPF.ViewModels;
|
||||
|
||||
public class YouTubeViewerDetailsFormViewModel : ViewModelBase
|
||||
{
|
||||
private string _userName;
|
||||
|
||||
public string UserName
|
||||
{
|
||||
get { return _userName; }
|
||||
set
|
||||
{
|
||||
_userName = value;
|
||||
OnPropertyChanged(nameof(UserName));
|
||||
OnPropertyChanged(nameof(CanSubmit));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isSubScribed;
|
||||
|
||||
public bool IsSubScribed
|
||||
{
|
||||
get { return _isSubScribed; }
|
||||
set
|
||||
{
|
||||
_isSubScribed = value;
|
||||
OnPropertyChanged(nameof(IsSubScribed));
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isMember;
|
||||
|
||||
|
||||
public bool IsMember
|
||||
{
|
||||
get { return _isMember; }
|
||||
set
|
||||
{
|
||||
_isMember = value;
|
||||
OnPropertyChanged(nameof(IsMember));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region IsSubmitting
|
||||
|
||||
private bool _IsSubmitting;
|
||||
public bool IsSubmitting
|
||||
{
|
||||
get { return _IsSubmitting; }
|
||||
set { _IsSubmitting = value; OnPropertyChanged(nameof(IsSubmitting)); }
|
||||
}
|
||||
|
||||
#endregion IsSubmitting
|
||||
|
||||
public bool CanSubmit => !string.IsNullOrEmpty(UserName);
|
||||
public ICommand SubmitCommand { get; }
|
||||
public ICommand CancelCommand { get; }
|
||||
public YouTubeViewerDetailsFormViewModel(ICommand submitCommand, ICommand cancelCommand)
|
||||
{
|
||||
SubmitCommand = submitCommand;
|
||||
CancelCommand = cancelCommand;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user