1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using HelloItQuantum.Function;
- using HelloItQuantum.Models;
- using HelloItQuantum.Views;
- using ReactiveUI;
- namespace HelloItQuantum.ViewModels
- {
- public class CreateProfileViewModel : MainWindowViewModel
- {
- #region
- string nickname = "";
- string name = "";
- string surname = "";
- public string Nickname { get => nickname; set => SetProperty(ref nickname, value); }
- public string Name { get => name; set => SetProperty(ref name, value); }
- public string Surname { get => surname; set => SetProperty(ref surname, value); }
- #endregion
- /// <summary>
- /// Ìåòîä, îáðàáàòûâàþùèé íàæàòèå íà êíîïêó Ñîçäàòü ïðîôèëü
- /// </summary>
- public void CreateProfile()
- {
- var newUser = new User();
- newUser.Nickname = Nickname;
- newUser.Name = Name;
- newUser.Surname = Name;
- newUser.GameHotkeys = 0;
- newUser.GameCreateFriend = 0;
- newUser.GameLabyrinth = 0;
- if (WorkWithFile.IsWriteUserInFile(newUser))
- {
- AuthVM = new AuthViewModel();
- PageSwitch.View = new AuthView();
- }
- else
- {
- //Òåõíè÷åñêèå øîêîëàäêè
- }
- }
- /// <summary>
- /// Ìåòîä, îáðàáàòûâàþùèé íàæàòèå íà êíîïêó Åñòü ïðîôèëü
- /// </summary>
- public void Auth()
- {
- AuthVM = new AuthViewModel();
- PageSwitch.View = new AuthView();
- }
- }
- }
|