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"> - - + + + + + + + + + + - + 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"> - - -