Gui angefangen

This commit is contained in:
Husky
2021-02-27 13:19:42 +01:00
parent c581f5e198
commit 2c4bcde9c8
9 changed files with 130 additions and 44 deletions

View File

@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace GuiWPF_ViewModel
{
public class MainViewModel : NotificationObject
{
public string Titel { get; set; }
public MainViewModel()
{
Titel = "Dichtheitsprüfung by Damian";
//Initialisieren();
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace GuiWPF_ViewModel
{
public class NotificationObject : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName]string propertyName="")
{
if(PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace GuiWPF_ViewModel
{
public class ViewModelBase : NotificationObject
{
private bool valIsBusy;
private string valBusyMessage;
public bool IsBusy
{
get => valIsBusy;
set
{
if(valIsBusy != value)
{
valIsBusy = value;
OnPropertyChanged();
}
}
}
public string BusyMessage
{
get => valBusyMessage;
set
{
if(valBusyMessage != value)
{
valBusyMessage = value;
OnPropertyChanged();
}
}
}
}
}