Change all icons to <Path>'s with google material icons; finish navigation bar styling and function
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
|
||||
internal class AnalyticsViewModel : BaseViewModel {
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,13 @@ namespace Server_Dashboard {
|
||||
|
||||
#endregion Private Values
|
||||
|
||||
#region Public Values
|
||||
|
||||
public SettingsViewModel SettingsViewModel { get; set; }
|
||||
public AnalyticsViewModel AnalyticsViewModel { get; set; }
|
||||
|
||||
#endregion Public Values
|
||||
|
||||
#region Properties
|
||||
|
||||
//The Username displayed defaults to Username
|
||||
@@ -44,6 +51,17 @@ namespace Server_Dashboard {
|
||||
}
|
||||
}
|
||||
|
||||
private object currentView;
|
||||
|
||||
public object CurrentView {
|
||||
get => currentView;
|
||||
set {
|
||||
if (value != currentView)
|
||||
currentView = value;
|
||||
OnPropertyChanged(nameof(currentView));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Constructor
|
||||
@@ -52,6 +70,10 @@ namespace Server_Dashboard {
|
||||
//Command init
|
||||
OpenLinkCommand = new RelayCommand(OpenLink);
|
||||
OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow);
|
||||
SwitchViewModelCommand = new RelayCommand(SwitchViewModel);
|
||||
AnalyticsViewModel = new AnalyticsViewModel();
|
||||
SettingsViewModel = new SettingsViewModel();
|
||||
CurrentView = this;
|
||||
|
||||
DataTable userData = DatabaseHandler.GetUserData(username);
|
||||
User = new User(userData);
|
||||
@@ -64,16 +86,33 @@ namespace Server_Dashboard {
|
||||
|
||||
public ICommand OpenLinkCommand { get; set; }
|
||||
public ICommand OpenNewModuleWindowCommand { get; set; }
|
||||
public ICommand SwitchViewModelCommand { get; set; }
|
||||
|
||||
#endregion ICommands
|
||||
|
||||
#region Commands
|
||||
|
||||
private void SwitchViewModel(object param) {
|
||||
switch (param) {
|
||||
case "settingsviewmodel":
|
||||
CurrentView = SettingsViewModel;
|
||||
break;
|
||||
|
||||
case "analyticsviewmodel":
|
||||
CurrentView = AnalyticsViewModel;
|
||||
break;
|
||||
|
||||
case "dashboardviewmodel":
|
||||
CurrentView = this;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens a given link in the default browser
|
||||
/// </summary>
|
||||
/// <param name="param">The Link to be opened e.g. https://github.com/Crylia/Server-Dashboard </param>
|
||||
private static void OpenLink(object param) => Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
||||
private void OpenLink(object param) => Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new window to create a new Module
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
|
||||
internal class SettingsViewModel : BaseViewModel {
|
||||
}
|
||||
}
|
||||
@@ -167,24 +167,25 @@ namespace Server_Dashboard {
|
||||
|
||||
default:
|
||||
//Sets the error text
|
||||
ErrorText = "An unknown error has occured";
|
||||
ErrorText = "An unknown error has occurred";
|
||||
return;
|
||||
}
|
||||
//If the Username and password is blank
|
||||
//All these IF's could be one but i made multiple for the different errors so the user knows whats wrong
|
||||
} else if (String.IsNullOrWhiteSpace(Username) && String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(Username) && string.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
//Sets the error text
|
||||
ErrorText = "Please provide a username and password";
|
||||
return;
|
||||
}
|
||||
//Only if the Username is empty
|
||||
if (String.IsNullOrWhiteSpace(Username)) {
|
||||
if (string.IsNullOrWhiteSpace(Username)) {
|
||||
//Sets the error text
|
||||
ErrorText = "Username cannot be empty.";
|
||||
return;
|
||||
}
|
||||
//Only if the password is empty
|
||||
if (String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
if (string.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
//Sets the error text
|
||||
ErrorText = "Password cannot be empty.";
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user