SelectedTournamentStore
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using Apollon.WPF.Models;
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,19 +10,20 @@ 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; }
|
||||
private readonly SelectedTournamentStore _selectedTournamentStore;
|
||||
|
||||
public ApollonOverviewDetailsViewModel()
|
||||
private Tournament _selectedTournament => _selectedTournamentStore.SelectedTournament;
|
||||
|
||||
public bool hasSelectedTournament => _selectedTournament != null;
|
||||
public string Organisation => _selectedTournament?.Organisation ?? "keine Organisation";
|
||||
public string Tournamentname => _selectedTournament?.Tournamentname ?? "kein Name";
|
||||
public string Category => _selectedTournament?.Category ?? "keine Kategorie";
|
||||
//public DateTime Datetime => _selectedTournament
|
||||
public string Location => _selectedTournament?.Location ?? "kein Ort";
|
||||
|
||||
public ApollonOverviewDetailsViewModel(SelectedTournamentStore selectedTournamentStore)
|
||||
{
|
||||
Organisation = "Deutscher Schützenbund";
|
||||
Tournamentname = "Deutsche Meisterschaft 2021";
|
||||
Category = "Bogenschießen im Freien";
|
||||
Datetime = DateTime.Now;
|
||||
Location = "Wiesbaden";
|
||||
_selectedTournamentStore = selectedTournamentStore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace Apollon.WPF.ViewModels
|
||||
|
||||
public ApollonOverviewListingItemViewModel(string tournamentname)
|
||||
{
|
||||
Tournamentname = tournamentname;
|
||||
Tournamentname = tournamentname;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
@@ -12,7 +13,7 @@ namespace Apollon.WPF.ViewModels
|
||||
private readonly ObservableCollection<ApollonOverviewListingItemViewModel> _apollonOverviewListingItemViewModels;
|
||||
public IEnumerable<ApollonOverviewListingItemViewModel> ApollonOverviewListingItemViewModels => _apollonOverviewListingItemViewModels;
|
||||
|
||||
public ApollonOverviewListingViewModel()
|
||||
public ApollonOverviewListingViewModel(SelectedTournamentStore _selectedTournamentStore)
|
||||
{
|
||||
_apollonOverviewListingItemViewModels = new ObservableCollection<ApollonOverviewListingItemViewModel>();
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -13,10 +14,10 @@ namespace Apollon.WPF.ViewModels
|
||||
public ApollonOverviewDetailsViewModel ApollonOverviewDetailsViewModel{ get; }
|
||||
public ICommand AddTournamentCommand { get; }
|
||||
|
||||
public ApollonOverviewViewModel()
|
||||
public ApollonOverviewViewModel(SelectedTournamentStore _selectedTournamentStore)
|
||||
{
|
||||
ApollonOverviewListingViewModel = new ApollonOverviewListingViewModel();
|
||||
ApollonOverviewDetailsViewModel = new ApollonOverviewDetailsViewModel();
|
||||
ApollonOverviewListingViewModel = new ApollonOverviewListingViewModel(_selectedTournamentStore);
|
||||
ApollonOverviewDetailsViewModel = new ApollonOverviewDetailsViewModel(_selectedTournamentStore);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ using System.Threading.Tasks;
|
||||
namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class ViewModelBase : INotifyPropertyChanged
|
||||
{
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPrpertyChanged(string properyName = null)
|
||||
protected virtual void OnPropertyChanged(string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(properyName));
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user