Ready for Commands

This commit is contained in:
Natlinux81
2022-08-14 03:05:01 +02:00
parent 311cd83b70
commit ab742103de
4 changed files with 25 additions and 7 deletions

View File

@@ -20,6 +20,9 @@
<DataTemplate DataType="{x:Type vms:AddTournametViewModel}"> <DataTemplate DataType="{x:Type vms:AddTournametViewModel}">
<views:AddTournamentView/> <views:AddTournamentView/>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type vms:EditTournamentViewModel}">
<views:EditTournamentView/>
</DataTemplate>
</Window.Resources> </Window.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" <ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">

View File

@@ -24,7 +24,7 @@ namespace Apollon.WPF.ViewModels
} }
private string _tournamentname; private string _tournamentname;
public string Tounamentname public string Tournamentname
{ {
get get
{ {
@@ -33,7 +33,7 @@ namespace Apollon.WPF.ViewModels
set set
{ {
_tournamentname = value; _tournamentname = value;
OnPropertyChanged(nameof(Tounamentname)); OnPropertyChanged(nameof(Tournamentname));
OnPropertyChanged(nameof(CanSubmit)); OnPropertyChanged(nameof(CanSubmit));
} }
} }
@@ -94,9 +94,9 @@ namespace Apollon.WPF.ViewModels
} }
} }
public bool CanSubmit => !string.IsNullOrEmpty(Tounamentname); public bool CanSubmit => !string.IsNullOrEmpty(Tournamentname);
public ICommand SubmitCommand { get; } public ICommand SubmitCommand { get; }
public ICommand CancleCommand { get; } public ICommand CancelCommand { get; }
} }

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Apollon.WPF.ViewModels
{
public class EditTournamentViewModel : ViewModelBase
{
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public EditTournamentViewModel()
{
AddEditDetailsViewModel = new AddEditDetailsViewModel();
}
}
}

View File

@@ -20,9 +20,7 @@ namespace Apollon.WPF.ViewModels
_modalNavigationStore = modalNavigationStore; _modalNavigationStore = modalNavigationStore;
OverviewViewModel = overviewViewModel; OverviewViewModel = overviewViewModel;
_modalNavigationStore.CurrentViewModelChanged += ModalNavigationStore_CurrentViewModelChanged; _modalNavigationStore.CurrentViewModelChanged += ModalNavigationStore_CurrentViewModelChanged;
//_modalNavigationStore.CurrentViewModel = new AddTournametViewModel();
} }
protected override void Dispose() protected override void Dispose()