init commit
This commit is contained in:
14
Server Dashboard/ViewModels/BaseViewModel/BaseViewModel.cs
Normal file
14
Server Dashboard/ViewModels/BaseViewModel/BaseViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class BaseViewModel : INotifyPropertyChanged {
|
||||
public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
|
||||
|
||||
protected void OnPropertyChanged(string prop) {
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Server Dashboard/ViewModels/DashboardModuleViewModel.cs
Normal file
28
Server Dashboard/ViewModels/DashboardModuleViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class DashboardModuleViewModel : BaseViewModel {
|
||||
public ObservableCollection<DashboardModule> Modules = new ObservableCollection<DashboardModule>();
|
||||
public DashboardModuleViewModel() {
|
||||
|
||||
}
|
||||
|
||||
#region Dashboard CRUD
|
||||
private void CreateDashboard() {
|
||||
|
||||
}
|
||||
private void UpdateDashboard() {
|
||||
|
||||
}
|
||||
private void GetDashboardInformation() {
|
||||
|
||||
}
|
||||
private void DeleteDashboard() {
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
8
Server Dashboard/ViewModels/MainViewModel.cs
Normal file
8
Server Dashboard/ViewModels/MainViewModel.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class MainViewModel : BaseViewModel {
|
||||
}
|
||||
}
|
||||
27
Server Dashboard/ViewModels/RelayCommand/RelayCommand.cs
Normal file
27
Server Dashboard/ViewModels/RelayCommand/RelayCommand.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class RelayCommand : ICommand {
|
||||
|
||||
//New Action
|
||||
private Action<object> execAction;
|
||||
|
||||
//Never gets fires, but needs to be implemented
|
||||
public event EventHandler CanExecuteChanged = (sender, e) => { };
|
||||
|
||||
/// <summary>
|
||||
/// Sets the given action to the private one
|
||||
/// </summary>
|
||||
/// <param name="action">The function to be executed</param>
|
||||
public RelayCommand(Action<object> action) => execAction = action;
|
||||
|
||||
//Makes all functions always executable
|
||||
public bool CanExecute(object parameter) { return true; }
|
||||
|
||||
//Executes the function
|
||||
public void Execute(object parameter) { execAction(parameter); }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user