public StartWindow(bool hasToken) : this()
 {
     if (!hasToken)
     {
         LoginPage loginPage = new LoginPage(this);
         mainFrame.Navigate(loginPage);
     }
     else
     {
         DevicePage devicePage = new DevicePage(this);
         mainFrame.Navigate(devicePage);
     }
 }
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            Status status = Client.Login(textUsername.Text, boxPassword.Password);

            if (status.status)
            {
                Settings.Token = status.token;
                Settings.SaveSettings();

                DevicePage devicePage = new DevicePage(this.context);
                this.NavigationService.Navigate(devicePage);
            }
            else
            {
                MessageBox.Show(status.message, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }