namespace HistoryView.ViewModels.Regions.SettingSubs;

internal partial class UserSettingViewModel : ObservableObject
{
    public UserSettingViewModel( UserInformation user, IEventAggregator eventAggregator, HubSender sender, MessageBoxHelper messageBoxHelper, UserCollection userCollection)
    {
        this.eventAggregator = eventAggregator;
        this.UserCollection = userCollection;
        this.UserInfo = user;
        this.SelectedUser = user;
        this.UserName = "NewUser";
        this.UserAuthoritySetting = User.Operator;
        this._sender = sender;
        this._messageBoxHelper = messageBoxHelper;
    }
    private readonly IEventAggregator eventAggregator;
    private readonly MessageBoxHelper _messageBoxHelper;
    private readonly HubSender _sender;


    [ObservableProperty]
    private UserCollection _UserCollection;

    [ObservableProperty]
    private UserInformation? _UserInfo;


    #region Update


    [ObservableProperty]
    private string _UserName;

    [ObservableProperty]
    private UserInformation? _SelectedUser;

    [ObservableProperty]
    private string? _ChangePassword;

    [ObservableProperty]
    private string? _ChangeComfirmPassword;
    #endregion

    #region Create
    [ObservableProperty]
    private User _UserAuthoritySetting;

    [ObservableProperty]
    private string? _Password;

    [ObservableProperty]
    private string? _ComfirmPassword;
    #endregion


    [RelayCommand]
    private void Operate(string para)
    {
        switch (para)
        {
            case "Update":
                break;

            case "Create":
                break;

            default:
                break;
        }
    }
}
