From e9b04dbe89ce0e6cd5ad8b3bf4d32de7f89dc023 Mon Sep 17 00:00:00 2001
From: Natlinux81 <97396587+Natlinux81@users.noreply.github.com>
Date: Tue, 9 Aug 2022 22:04:43 +0200
Subject: [PATCH] Overview
Creating a Startwindow
---
Apollon.WPF/Apollon.WPF.csproj | 4 ++
Apollon.WPF/App.xaml.cs | 8 ++-
Apollon.WPF/MainWindow.xaml | 6 +-
Apollon.WPF/Stores/SelectedApollonStore.cs | 13 ++++
.../ApollonOverviewDetailsViewModel.cs | 26 ++++++++
.../ApollonOverviewListingItemViewModel.cs | 20 +++++++
.../ApollonOverviewListingViewModel.cs | 24 ++++++++
.../ViewModels/ApollonOverviewViewModel.cs | 22 +++++++
.../{BaseViewModel.cs => ViewModelBase.cs} | 6 +-
Apollon.WPF/Views/ApollonOverviewView.xaml | 60 ++++++++++++++-----
.../Components/ApollonOverViewListing.xaml | 45 ++++++++++++--
.../Components/ApollonOverviewDetails.xaml | 6 +-
12 files changed, 210 insertions(+), 30 deletions(-)
create mode 100644 Apollon.WPF/Stores/SelectedApollonStore.cs
create mode 100644 Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs
create mode 100644 Apollon.WPF/ViewModels/ApollonOverviewListingItemViewModel.cs
create mode 100644 Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs
create mode 100644 Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs
rename Apollon.WPF/ViewModels/{BaseViewModel.cs => ViewModelBase.cs} (60%)
diff --git a/Apollon.WPF/Apollon.WPF.csproj b/Apollon.WPF/Apollon.WPF.csproj
index 4106cb0..d4e24f0 100644
--- a/Apollon.WPF/Apollon.WPF.csproj
+++ b/Apollon.WPF/Apollon.WPF.csproj
@@ -7,4 +7,8 @@
true
+
+
+
+
diff --git a/Apollon.WPF/App.xaml.cs b/Apollon.WPF/App.xaml.cs
index 5db7d55..698b254 100644
--- a/Apollon.WPF/App.xaml.cs
+++ b/Apollon.WPF/App.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using Apollon.WPF.ViewModels;
+using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
@@ -15,7 +16,10 @@ namespace Apollon.WPF
{
protected override void OnStartup(StartupEventArgs e)
{
- MainWindow = new MainWindow();
+ MainWindow = new MainWindow()
+ {
+ DataContext = new ApollonOverviewViewModel()
+ };
MainWindow.Show();
base.OnStartup(e);
diff --git a/Apollon.WPF/MainWindow.xaml b/Apollon.WPF/MainWindow.xaml
index 68d4708..cc45e00 100644
--- a/Apollon.WPF/MainWindow.xaml
+++ b/Apollon.WPF/MainWindow.xaml
@@ -31,7 +31,7 @@
BorderBrush="Transparent"
Content="🗙"
FontSize="20"
- Foreground="SlateGray"
+ Foreground="#0000a0"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Right" Margin="0,2,24,8"
@@ -45,7 +45,7 @@
Content="☐"
FontSize="20"
FontWeight="UltraBold"
- Foreground="SlateGray"
+ Foreground="#0000a0"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Right" Margin="0,2,64,8"
@@ -61,7 +61,7 @@
Content="🗕"
FontSize="20"
FontWeight="Bold"
- Foreground="SlateGray"
+ Foreground="#0000a0"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Right" Margin="0,2,104,8"
diff --git a/Apollon.WPF/Stores/SelectedApollonStore.cs b/Apollon.WPF/Stores/SelectedApollonStore.cs
new file mode 100644
index 0000000..4b1afe7
--- /dev/null
+++ b/Apollon.WPF/Stores/SelectedApollonStore.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Apollon.WPF.Stores
+{
+ public class SelectedApollonStore
+ {
+ public int MyProperty { get; set; }
+ }
+}
diff --git a/Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs b/Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs
new file mode 100644
index 0000000..05b2367
--- /dev/null
+++ b/Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Apollon.WPF.ViewModels
+{
+ public class ApollonOverviewDetailsViewModel : ViewModelBase
+ {
+ public string Organisation { get; }
+ public string Tournamentname { get; }
+ public string Category { get; }
+ public DateTime Datetime { get; }
+ public string Location { get; }
+
+ public ApollonOverviewDetailsViewModel()
+ {
+ Organisation = "Deutscher Schützenbund";
+ Tournamentname = "Deutsche Meisterschaft 2021";
+ Category = "Bogenschießen im Freien";
+ Datetime = DateTime.Now;
+ Location = "Wiesbaden";
+ }
+ }
+}
diff --git a/Apollon.WPF/ViewModels/ApollonOverviewListingItemViewModel.cs b/Apollon.WPF/ViewModels/ApollonOverviewListingItemViewModel.cs
new file mode 100644
index 0000000..6b93d94
--- /dev/null
+++ b/Apollon.WPF/ViewModels/ApollonOverviewListingItemViewModel.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace Apollon.WPF.ViewModels
+{
+ public class ApollonOverviewListingItemViewModel : ViewModelBase
+ {
+ public string Tournamentname { get; }
+ public ICommand DeleteCommand { get; }
+
+ public ApollonOverviewListingItemViewModel(string tournamentname)
+ {
+ Tournamentname = tournamentname;
+ }
+ }
+}
diff --git a/Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs b/Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs
new file mode 100644
index 0000000..95b0605
--- /dev/null
+++ b/Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Apollon.WPF.ViewModels
+{
+ public class ApollonOverviewListingViewModel : ViewModelBase
+ {
+ private readonly ObservableCollection _apollonOverviewListingItemViewModels;
+ public IEnumerable ApollonOverviewListingItemViewModels => _apollonOverviewListingItemViewModels;
+
+ public ApollonOverviewListingViewModel()
+ {
+ _apollonOverviewListingItemViewModels = new ObservableCollection();
+
+ _apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft1"));
+ _apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft2"));
+ _apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft3"));
+ }
+ }
+}
diff --git a/Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs b/Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs
new file mode 100644
index 0000000..ca8bf60
--- /dev/null
+++ b/Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+
+namespace Apollon.WPF.ViewModels
+{
+ public class ApollonOverviewViewModel : ViewModelBase
+ {
+ public ApollonOverviewListingViewModel ApollonOverviewListingViewModel { get; }
+ public ApollonOverviewDetailsViewModel ApollonOverviewDetailsViewModel{ get; }
+ public ICommand AddTournamentCommand { get; }
+
+ public ApollonOverviewViewModel()
+ {
+ ApollonOverviewListingViewModel = new ApollonOverviewListingViewModel();
+ ApollonOverviewDetailsViewModel = new ApollonOverviewDetailsViewModel();
+ }
+ }
+}
diff --git a/Apollon.WPF/ViewModels/BaseViewModel.cs b/Apollon.WPF/ViewModels/ViewModelBase.cs
similarity index 60%
rename from Apollon.WPF/ViewModels/BaseViewModel.cs
rename to Apollon.WPF/ViewModels/ViewModelBase.cs
index fddbe89..070a8f6 100644
--- a/Apollon.WPF/ViewModels/BaseViewModel.cs
+++ b/Apollon.WPF/ViewModels/ViewModelBase.cs
@@ -7,11 +7,11 @@ using System.Threading.Tasks;
namespace Apollon.WPF.ViewModels
{
- public class BaseViewModel : INotifyPropertyChanged
+ public class ViewModelBase : INotifyPropertyChanged
{
- public event PropertyChangedEventHandler? PropertyChanged;
+ public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPrpertyChanged(string properyName)
+ protected virtual void OnPrpertyChanged(string properyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(properyName));
}
diff --git a/Apollon.WPF/Views/ApollonOverviewView.xaml b/Apollon.WPF/Views/ApollonOverviewView.xaml
index a7c2a1e..8466a8d 100644
--- a/Apollon.WPF/Views/ApollonOverviewView.xaml
+++ b/Apollon.WPF/Views/ApollonOverviewView.xaml
@@ -43,38 +43,68 @@
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
- FontSize="18"
+ FontSize="20"
Foreground="#0000a0">
-
-
+
+
+
+
+
+ Margin="40"
+ Cursor="Hand"
+ Command="{Binding AddTournamentCommand}"/>
+
-
+
+
+
+
+
+
+
+
-
-
-
-
+ Margin="40"
+ Cursor="Hand"/>
+
+
diff --git a/Apollon.WPF/Views/Components/ApollonOverViewListing.xaml b/Apollon.WPF/Views/Components/ApollonOverViewListing.xaml
index afa9128..2b6e2a9 100644
--- a/Apollon.WPF/Views/Components/ApollonOverViewListing.xaml
+++ b/Apollon.WPF/Views/Components/ApollonOverViewListing.xaml
@@ -3,15 +3,52 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
+ xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
+
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
-
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/Apollon.WPF/Views/Components/ApollonOverviewDetails.xaml b/Apollon.WPF/Views/Components/ApollonOverviewDetails.xaml
index e7a30f6..8c8e151 100644
--- a/Apollon.WPF/Views/Components/ApollonOverviewDetails.xaml
+++ b/Apollon.WPF/Views/Components/ApollonOverviewDetails.xaml
@@ -12,21 +12,21 @@
CornerRadius="10">
-
-
-