Application ready before dependency injction

This commit is contained in:
2022-08-23 23:31:45 +02:00
parent d3b7ff17be
commit 2b42691434
15 changed files with 234 additions and 78 deletions

View File

@ -59,6 +59,25 @@ public class YouTubeViewerDetailsFormViewModel : ViewModelBase
#endregion IsSubmitting
#region ErrorMessage
private string _errorMessage;
public string ErrorMessage
{
get { return _errorMessage; }
set
{
_errorMessage = value;
OnPropertyChanged(nameof(ErrorMessage));
OnPropertyChanged(nameof(HasErrorMessage));
}
}
#endregion ErrorMessage
public bool HasErrorMessage => !string.IsNullOrEmpty(ErrorMessage);
public bool CanSubmit => !string.IsNullOrEmpty(UserName);
public ICommand SubmitCommand { get; }
public ICommand CancelCommand { get; }

View File

@ -20,6 +20,35 @@ namespace YouTubeViewers.WPF.ViewModels
public string UserName => YouTubeViewer.Username;
#region IsDeleting
private bool _isDeleting;
public bool IsDeleting
{
get { return _isDeleting; }
set { _isDeleting = value; OnPropertyChanged(); }
}
#endregion IsDeleting
#region ErrorMessage
private string _errorMessage;
public string ErrorMessage
{
get { return _errorMessage; }
set
{
_errorMessage = value;
OnPropertyChanged(nameof(ErrorMessage));
OnPropertyChanged(nameof(HasErrorMessage));
}
}
#endregion ErrorMessage
public bool HasErrorMessage => !string.IsNullOrEmpty(ErrorMessage);
public ICommand EditCommand { get; }
public ICommand DeleteCommand { get; }

View File

@ -29,6 +29,23 @@ namespace YouTubeViewers.WPF.ViewModels
}
}
#region ErrorMessage
private string _errorMessage;
public string ErrorMessage
{
get { return _errorMessage; }
set { _errorMessage = value;
OnPropertyChanged(nameof(ErrorMessage));
OnPropertyChanged(nameof(HasErrorMessage));
}
}
#endregion ErrorMessage
public bool HasErrorMessage => !string.IsNullOrEmpty(ErrorMessage);
public ICommand LoadYouTubeViewersCommand { get; }
public ICommand AddYouTubeViewersCommand { get; }
public YouTubeViewersViewModel(YouTubeViewersStore youTubeViewersStore, SelectedYouTubeViewerStore _selectedYouTubeViewerStore, ModalNavigationStore modalNavigationStore)