Overview
Creating a Startwindow
This commit is contained in:
26
Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs
Normal file
26
Apollon.WPF/ViewModels/ApollonOverviewDetailsViewModel.cs
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs
Normal file
24
Apollon.WPF/ViewModels/ApollonOverviewListingViewModel.cs
Normal 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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs
Normal file
22
Apollon.WPF/ViewModels/ApollonOverviewViewModel.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user