From 5d89391e933bedcc0f1f0b42027be03e4084095b Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Wed, 5 May 2021 13:32:46 +0200 Subject: [PATCH] Daten werden nun geladen --- GuiWPF/App.config | 6 +++++ GuiWPF/App.xaml | 4 +-- GuiWPF/App.xaml.cs | 5 ++-- GuiWPF/AssemblyInfo.cs | 10 -------- GuiWPF/DelegateCommand.cs | 14 +++++++--- GuiWPF/GuiWPF.csproj.user | 5 ++++ GuiWPF/HomePage.cs | 16 +++++++++--- GuiWPF/HomePageView.xaml | 25 +++++++++--------- GuiWPF/HomePageView.xaml.cs | 28 ++++++++++++++++++++ GuiWPF/HomePageViewModel.cs | 35 +++++++++++++------------ GuiWPF/MainViewModel.cs | 45 --------------------------------- GuiWPF/MainWindow.xaml | 10 ++++---- GuiWPF/MainWindow.xaml.cs | 8 +++--- GuiWPF/MainWindowViewModel.cs | 45 +++++++++++++++++++++++++++++++++ GuiWPF/NotificationObject.cs | 21 --------------- GuiWPF/SettingsPage.cs | 13 ++++++++++ GuiWPF/SettingsPageView.xaml | 23 +++++++++-------- GuiWPF/SettingsPageView.xaml.cs | 28 ++++++++++++++++++++ GuiWPF/SettingsPageViewModel.cs | 27 +++++++++++++++----- GuiWPF/ViewModelBase.cs | 38 ++++++++++------------------ 20 files changed, 236 insertions(+), 170 deletions(-) create mode 100644 GuiWPF/App.config delete mode 100644 GuiWPF/AssemblyInfo.cs create mode 100644 GuiWPF/GuiWPF.csproj.user create mode 100644 GuiWPF/HomePageView.xaml.cs delete mode 100644 GuiWPF/MainViewModel.cs create mode 100644 GuiWPF/MainWindowViewModel.cs delete mode 100644 GuiWPF/NotificationObject.cs create mode 100644 GuiWPF/SettingsPage.cs create mode 100644 GuiWPF/SettingsPageView.xaml.cs diff --git a/GuiWPF/App.config b/GuiWPF/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/GuiWPF/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/GuiWPF/App.xaml b/GuiWPF/App.xaml index 24a8184..e551053 100644 --- a/GuiWPF/App.xaml +++ b/GuiWPF/App.xaml @@ -1,7 +1,7 @@ - diff --git a/GuiWPF/App.xaml.cs b/GuiWPF/App.xaml.cs index d8f7545..4cb5730 100644 --- a/GuiWPF/App.xaml.cs +++ b/GuiWPF/App.xaml.cs @@ -6,13 +6,12 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; -namespace GuiWPF +namespace WPF { /// - /// Interaction logic for App.xaml + /// Interaktionslogik für "App.xaml" /// public partial class App : Application { - } } diff --git a/GuiWPF/AssemblyInfo.cs b/GuiWPF/AssemblyInfo.cs deleted file mode 100644 index 2211234..0000000 --- a/GuiWPF/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Windows; - -[assembly:ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] diff --git a/GuiWPF/DelegateCommand.cs b/GuiWPF/DelegateCommand.cs index 563c40e..0fb734a 100644 --- a/GuiWPF/DelegateCommand.cs +++ b/GuiWPF/DelegateCommand.cs @@ -1,8 +1,14 @@ -using System; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; using System.Windows.Input; -namespace GuiWPF { - public class DelegateCommand : ICommand { +namespace WPF +{ + public class DelegateCommand : ICommand + { /// /// Action to be performed when this command is executed /// @@ -72,4 +78,4 @@ namespace GuiWPF { this.executionAction(parameter); } } -} \ No newline at end of file +} diff --git a/GuiWPF/GuiWPF.csproj.user b/GuiWPF/GuiWPF.csproj.user new file mode 100644 index 0000000..b5309f2 --- /dev/null +++ b/GuiWPF/GuiWPF.csproj.user @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/GuiWPF/HomePage.cs b/GuiWPF/HomePage.cs index 29d1360..16feaa0 100644 --- a/GuiWPF/HomePage.cs +++ b/GuiWPF/HomePage.cs @@ -1,5 +1,13 @@ -namespace GuiWPF { - public class HomePage { - public string PageTitle {get;set;} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WPF +{ + public class HomePage + { + public string PageTitle { get; set; } } -} \ No newline at end of file +} diff --git a/GuiWPF/HomePageView.xaml b/GuiWPF/HomePageView.xaml index b523fba..160631c 100644 --- a/GuiWPF/HomePageView.xaml +++ b/GuiWPF/HomePageView.xaml @@ -1,12 +1,13 @@ - - - - - - \ No newline at end of file + + + + + + diff --git a/GuiWPF/HomePageView.xaml.cs b/GuiWPF/HomePageView.xaml.cs new file mode 100644 index 0000000..e3d1408 --- /dev/null +++ b/GuiWPF/HomePageView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace WPF +{ + /// + /// Interaktionslogik für HomePageView.xaml + /// + public partial class HomePageView : UserControl + { + public HomePageView() + { + InitializeComponent(); + } + } +} diff --git a/GuiWPF/HomePageViewModel.cs b/GuiWPF/HomePageViewModel.cs index 3e4073f..69eafaa 100644 --- a/GuiWPF/HomePageViewModel.cs +++ b/GuiWPF/HomePageViewModel.cs @@ -1,27 +1,26 @@ -using System; +using System; using System.Collections.Generic; -using System.Diagnostics; +using System.Linq; using System.Text; +using System.Threading.Tasks; -namespace GuiWPF +namespace WPF { - public class HomePageViewModel : ViewModelBase { - //public string PageTitle = "HomePage"; - public HomePage Model {get; private set;} - public HomePageViewModel(HomePage model) { + public class HomePageViewModel : ViewModelBase + { + public HomePageViewModel(HomePage model) + { this.Model = model; - } - - public string PageTitle { - get { - return Model.PageTitle; - } - set { - Model.PageTitle = value; - OnPropertyChanged(); + public HomePage Model { get; private set; } + public string PageTitle + { + get => this.Model.PageTitle; + set + { + this.Model.PageTitle = value; + this.OnPropertyChanged("PageTitle"); } } } - -} \ No newline at end of file +} diff --git a/GuiWPF/MainViewModel.cs b/GuiWPF/MainViewModel.cs deleted file mode 100644 index da5c659..0000000 --- a/GuiWPF/MainViewModel.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Windows.Input; - -namespace GuiWPF -{ - public class MainViewModel : ViewModelBase - { - public string PageTitle { get; set; } - public ICommand LoadHomePageCommand {get; private set;} - public ICommand LoadSettingsPageCommand {get; private set;} - - private ViewModelBase _currentViewModel; - public ViewModelBase CurrentViewModel { - get { - Trace.WriteLine("CurrentAbgefragt"); - return _currentViewModel; - } - set { - Trace.WriteLine("CurrentView ist geändert worden"); - _currentViewModel = value; - OnPropertyChanged(); - } - } - - public MainViewModel() - { - PageTitle = "Dichtheitsprüfung by Damian"; - LoadHomePage(); - LoadHomePageCommand = new DelegateCommand(o => this.LoadHomePage()); - LoadSettingsPageCommand = new DelegateCommand(o => this.LoadSettingsPage()); - - //Initialisieren(); - } - - private void LoadHomePage() { - CurrentViewModel = new HomePageViewModel(new HomePage() { PageTitle = "Home"}); - } - private void LoadSettingsPage() { - CurrentViewModel = new SettingsPageViewModel(); - } - } -} diff --git a/GuiWPF/MainWindow.xaml b/GuiWPF/MainWindow.xaml index 856eefe..be2f97a 100644 --- a/GuiWPF/MainWindow.xaml +++ b/GuiWPF/MainWindow.xaml @@ -1,11 +1,11 @@ - + Title="MainWindow" Height="450" Width="800"> @@ -17,8 +17,8 @@