private void AccountCreateButton_onClick(object sender, RoutedEventArgs e)
        {
            bool result = RestClient.Instance.MakePostRequest("TryCreateUserAccount", new User()
            {
                Name     = nameTextBox.Text,
                Surname  = surnameTextBox.Text,
                Email    = emailTextBox.Text,
                Adress   = adressTextBox.Text,
                Login    = loginTextBox.Text,
                Password = passwordTextBox.Password
            });

            if (result)
            {
                RestClient.Instance.LoggedUserLogin = loginTextBox.Text;
                Window window = new UserInfoWindow();
                ((UserInfoWindow)window).UpdateAfterRegister = true;
                App.Current.MainWindow = window;
                window.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Podane dane nie pozwalają na utworzenie nowego konta",
                                "Register error",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }
        private void UpdateUserInfoButton_Click(object sender, RoutedEventArgs e)
        {
            Window loginWindow = new UserInfoWindow();

            App.Current.MainWindow = loginWindow;
            loginWindow.Show();
            this.Close();
        }