redesign to material standards and clean up some sylings
This commit is contained in:
@@ -1,15 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class DashboardModuleViewModel : BaseViewModel {
|
||||
public ObservableCollection<DashboardModule> Modules = new ObservableCollection<DashboardModule>();
|
||||
public DashboardModuleViewModel() {
|
||||
|
||||
private ObservableCollection<DashboardModule> modules;
|
||||
|
||||
public ObservableCollection<DashboardModule> Modules {
|
||||
get { return modules; }
|
||||
set {
|
||||
if (modules != value)
|
||||
modules = value;
|
||||
OnPropertyChanged(nameof(modules));
|
||||
}
|
||||
}
|
||||
|
||||
public DashboardModuleViewModel() {
|
||||
Modules = new ObservableCollection<DashboardModule>();
|
||||
for (int i = 0; i < 1; i++) {
|
||||
Modules.Add(new DashboardModule() {
|
||||
Creator = "Ersteller TestUser",
|
||||
ModulName = "TestName",
|
||||
ModuleIcon = "../../Assets/Images/PlaceHolderModuleLight.png",
|
||||
Width = new Random().Next(300, 400),
|
||||
Height = new Random().Next(100, 400),
|
||||
});
|
||||
}
|
||||
var sort = Modules.OrderBy(h => h.Height).ThenBy(w => w.Width).ToList();
|
||||
Modules = new ObservableCollection<DashboardModule>(sort);
|
||||
}
|
||||
#region Dashboard CRUD
|
||||
private void CreateDashboard() {
|
||||
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class DashboardViewModel : BaseViewModel {
|
||||
private string userName = "Username";
|
||||
|
||||
public string UserName {
|
||||
get { return userName; }
|
||||
set {
|
||||
if(userName != value)
|
||||
userName = value;
|
||||
OnPropertyChanged(nameof(userName));
|
||||
}
|
||||
}
|
||||
|
||||
public DashboardViewModel() {
|
||||
OpenLinkCommand = new RelayCommand(OpenLink);
|
||||
}
|
||||
|
||||
public ICommand OpenLinkCommand { get; set; }
|
||||
|
||||
private void OpenLink(object param) {
|
||||
Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace Server_Dashboard {
|
||||
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
if (DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure())) {
|
||||
DashboardWindow window = new DashboardWindow();
|
||||
window.DataContext = new DashboardViewModel();
|
||||
window.Show();
|
||||
Close?.Invoke();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user