WPF endgültiv vorbereitet

This commit is contained in:
HuskyTeufel
2021-05-05 13:49:59 +02:00
parent 3d3de440ec
commit f66815fda5
7 changed files with 12 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GuiWPF"
StartupUri="MainWindow.xaml">
>
<Application.Resources>
</Application.Resources>

View File

@@ -13,5 +13,11 @@ namespace GuiWPF
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var window = new MainWindow() { DataContext = new MainWindowViewModel() };
window.Show();
}
}
}

View File

@@ -19,7 +19,7 @@ namespace GuiWPF
set
{
this.Model.PageTitle = value;
this.OnPropertyChanged("PageTitle");
this.OnPropertyChanged();
}
}
}

View File

@@ -23,7 +23,6 @@ namespace GuiWPF
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
}
}
}

View File

@@ -19,7 +19,7 @@ namespace GuiWPF
set
{
_currentViewModel = value;
OnPropertyChanged("CurrentViewModel");
OnPropertyChanged();
}
}

View File

@@ -19,7 +19,7 @@ namespace GuiWPF
set
{
this.Model.PageTitle = value;
this.OnPropertyChanged("PageTitle");
this.OnPropertyChanged();
}
}
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
@@ -10,7 +11,7 @@ namespace GuiWPF
public abstract class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
protected void OnPropertyChanged([CallerMemberName]string propertyName = "")
{
this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
}