Creating a Startwindow
This commit is contained in:
Natlinux81
2022-08-09 22:04:43 +02:00
parent 14d6e027f9
commit e9b04dbe89
12 changed files with 210 additions and 30 deletions

View File

@@ -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";
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -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<ApollonOverviewListingItemViewModel> _apollonOverviewListingItemViewModels;
public IEnumerable<ApollonOverviewListingItemViewModel> ApollonOverviewListingItemViewModels => _apollonOverviewListingItemViewModels;
public ApollonOverviewListingViewModel()
{
_apollonOverviewListingItemViewModels = new ObservableCollection<ApollonOverviewListingItemViewModel>();
_apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft1"));
_apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft2"));
_apollonOverviewListingItemViewModels.Add(new ApollonOverviewListingItemViewModel("Testmeisterschaft3"));
}
}
}

View File

@@ -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();
}
}
}

View File

@@ -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));
}