Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel Class Reference

View model for the race preparation page. More...

Inheritance diagram for Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel:
Vereinsmeisterschaften.Contracts.ViewModels.INavigationAware

Public Member Functions

 PrepareRacesViewModel (IRaceService raceService, IWorkspaceService workspaceService, IPersonService personService, IDialogCoordinator dialogCoordinator, ShellViewModel shellVM)
 Constructor of the prepare races view model.
 
void OnNavigatedTo (object parameter)
 OnNavigatedTo method to handle navigation to this object.
Parameters
parameterParameter that can be passed by the caller

 
void OnNavigatedFrom ()
 OnNavigatedFrom method to handle navigation away from this object.
 

Properties

ObservableCollection< RacesVariantAllRacesVariants [get]
 List with all RacesVariant
 
bool AreRacesVariantsAvailable [get]
 True, if there is at least one element in AllRacesVariants
 
bool AreFriendGroupsAvailable [get]
 True, if there are friend groups available in the IPersonService
 
int CurrentVariantID [get, set]
 RacesVariant.VariantID of the CurrentRacesVariant Use 0 to select the RaceService.PersistedRacesVariant or the first element in AllRacesVariants if CurrentRacesVariant is null.
 
RacesVariant CurrentRacesVariant [get, set]
 RacesVariant that is currently displayed on the view
 
bool CurrentRacesVariantIsPersistent [get, set]
 Property wrapper for the RacesVariant.IsPersistent property of the CurrentRacesVariant.
 
HighlightPersonStartModes HighlightPersonStartMode [get, set]
 Currently active highlight mode.
 
List< PersonAvailablePersons [get]
 List with all available Person objects.
 
Person HighlightedPerson [get, set]
 All PersonStart elements that match this Person will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Person
 
List< SwimmingStylesAvailableSwimmingStyles [get]
 List with all available SwimmingStyles
 
SwimmingStyles HighlightedSwimmingStyle [get, set]
 All PersonStart elements that match this SwimmingStyles will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.SwimmingStyle
 
Genders HighlightedGender [get, set]
 All PersonStart elements that match this Genders will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Gender
 
ushort HighlightedDistance [get, set]
 All PersonStart elements that match this distance will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Distance
 
ICommand CalculateRacesVariantsCommand [get]
 Command to calculate new RacesVariant variants.
 
ICommand AddNewRaceCommand [get]
 Command to add a new Race to the CurrentRacesVariant
 
ICommand CleanupRacesCommand [get]
 Command to cleanup all RacesVariant in RaceService.AllRacesVariants
 
ICommand AddNewRaceVariantCommand [get]
 Add a new RacesVariant element to the RaceService.AllRacesVariants
 
ICommand RemoveRaceVariantCommand [get]
 Remove the CurrentRacesVariant from the RaceService.AllRacesVariants
 
ICommand CopyRaceVariantCommand [get]
 Copy the CurrentRacesVariant and add it as new variant to RaceService.AllRacesVariants
 
ICommand ReorderRaceVariantsCommand [get]
 Reorder the RacesVariant variants by score and then recalculate the variant IDs.
 

Private Member Functions

void recalculateVariantIDs ()
 Recalculate the variant IDs for all elements in AllRacesVariants
 
void recalculateHighlightedPersonStarts ()
 Recalculate the PersonStart.IsHighlighted property for all PersonStart objects depending on the HighlightPersonStartMode
 

Private Attributes

RacesVariant _currentRacesVariant
 
HighlightPersonStartModes _highlightPersonStartMode
 
Person _highlightedPerson
 
List< SwimmingStyles_availableSwimmingStyles = Enum.GetValues(typeof(SwimmingStyles)).Cast<SwimmingStyles>().Where(s => s != SwimmingStyles.Unknown).ToList()
 
SwimmingStyles _highlightedSwimmingStyle
 
Genders _highlightedGender
 
ushort _highlightedDistance
 
IRaceService _raceService
 
IWorkspaceService _workspaceService
 
IPersonService _personService
 
IDialogCoordinator _dialogCoordinator
 
ShellViewModel _shellVM
 
ICommand _calculateRacesVariantsCommand
 
ICommand _addNewRaceCommand
 
ICommand _cleanupRacesCommand
 
ICommand _addNewRaceVariantCommand
 
ICommand _removeRaceVariantCommand
 
ICommand _copyRaceVariantCommand
 
ICommand _reorderRaceVariantsCommand
 

Detailed Description

View model for the race preparation page.

Definition at line 18 of file PrepareRacesViewModel.cs.

Constructor & Destructor Documentation

◆ PrepareRacesViewModel()

Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.PrepareRacesViewModel ( IRaceService raceService,
IWorkspaceService workspaceService,
IPersonService personService,
IDialogCoordinator dialogCoordinator,
ShellViewModel shellVM )

Constructor of the prepare races view model.

Parameters
raceServiceIRaceService object
workspaceServiceIWorkspaceService object
personServiceIPersonService object
dialogCoordinatorIDialogCoordinator object
shellVMShellViewModel object used for dialog display

Definition at line 267 of file PrepareRacesViewModel.cs.

Member Function Documentation

◆ OnNavigatedFrom()

void Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.OnNavigatedFrom ( )

OnNavigatedFrom method to handle navigation away from this object.

Implements Vereinsmeisterschaften.Contracts.ViewModels.INavigationAware.

Definition at line 492 of file PrepareRacesViewModel.cs.

◆ OnNavigatedTo()

void Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.OnNavigatedTo ( object parameter)

OnNavigatedTo method to handle navigation to this object.

Parameters
parameterParameter that can be passed by the caller

Implements Vereinsmeisterschaften.Contracts.ViewModels.INavigationAware.

Definition at line 475 of file PrepareRacesViewModel.cs.

◆ recalculateHighlightedPersonStarts()

void Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.recalculateHighlightedPersonStarts ( )
private

Recalculate the PersonStart.IsHighlighted property for all PersonStart objects depending on the HighlightPersonStartMode

Definition at line 232 of file PrepareRacesViewModel.cs.

◆ recalculateVariantIDs()

void Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.recalculateVariantIDs ( )
private

Recalculate the variant IDs for all elements in AllRacesVariants

Definition at line 89 of file PrepareRacesViewModel.cs.

Member Data Documentation

◆ _addNewRaceCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._addNewRaceCommand
private

Definition at line 370 of file PrepareRacesViewModel.cs.

◆ _addNewRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._addNewRaceVariantCommand
private

Definition at line 395 of file PrepareRacesViewModel.cs.

◆ _availableSwimmingStyles

List<SwimmingStyles> Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._availableSwimmingStyles = Enum.GetValues(typeof(SwimmingStyles)).Cast<SwimmingStyles>().Where(s => s != SwimmingStyles.Unknown).ToList()
private

Definition at line 169 of file PrepareRacesViewModel.cs.

◆ _calculateRacesVariantsCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._calculateRacesVariantsCommand
private

Definition at line 304 of file PrepareRacesViewModel.cs.

◆ _cleanupRacesCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._cleanupRacesCommand
private

Definition at line 384 of file PrepareRacesViewModel.cs.

◆ _copyRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._copyRaceVariantCommand
private

Definition at line 443 of file PrepareRacesViewModel.cs.

◆ _currentRacesVariant

RacesVariant Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._currentRacesVariant
private

Definition at line 67 of file PrepareRacesViewModel.cs.

◆ _dialogCoordinator

IDialogCoordinator Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._dialogCoordinator
private

Definition at line 256 of file PrepareRacesViewModel.cs.

◆ _highlightedDistance

ushort Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._highlightedDistance
private

Definition at line 211 of file PrepareRacesViewModel.cs.

◆ _highlightedGender

Genders Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._highlightedGender
private

Definition at line 193 of file PrepareRacesViewModel.cs.

◆ _highlightedPerson

Person Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._highlightedPerson
private

Definition at line 151 of file PrepareRacesViewModel.cs.

◆ _highlightedSwimmingStyle

SwimmingStyles Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._highlightedSwimmingStyle
private

Definition at line 175 of file PrepareRacesViewModel.cs.

◆ _highlightPersonStartMode

HighlightPersonStartModes Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._highlightPersonStartMode
private

Definition at line 128 of file PrepareRacesViewModel.cs.

◆ _personService

IPersonService Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._personService
private

Definition at line 255 of file PrepareRacesViewModel.cs.

◆ _raceService

IRaceService Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._raceService
private

Definition at line 253 of file PrepareRacesViewModel.cs.

◆ _removeRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._removeRaceVariantCommand
private

Definition at line 412 of file PrepareRacesViewModel.cs.

◆ _reorderRaceVariantsCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._reorderRaceVariantsCommand
private

Definition at line 460 of file PrepareRacesViewModel.cs.

◆ _shellVM

ShellViewModel Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._shellVM
private

Definition at line 257 of file PrepareRacesViewModel.cs.

◆ _workspaceService

IWorkspaceService Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel._workspaceService
private

Definition at line 254 of file PrepareRacesViewModel.cs.

Property Documentation

◆ AddNewRaceCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AddNewRaceCommand
get

Command to add a new Race to the CurrentRacesVariant

Definition at line 374 of file PrepareRacesViewModel.cs.

◆ AddNewRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AddNewRaceVariantCommand
get

Add a new RacesVariant element to the RaceService.AllRacesVariants

Definition at line 399 of file PrepareRacesViewModel.cs.

◆ AllRacesVariants

ObservableCollection<RacesVariant> Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AllRacesVariants
get

List with all RacesVariant

Definition at line 25 of file PrepareRacesViewModel.cs.

◆ AreFriendGroupsAvailable

bool Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AreFriendGroupsAvailable
get

True, if there are friend groups available in the IPersonService

Definition at line 35 of file PrepareRacesViewModel.cs.

◆ AreRacesVariantsAvailable

bool Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AreRacesVariantsAvailable
get

True, if there is at least one element in AllRacesVariants

Definition at line 30 of file PrepareRacesViewModel.cs.

◆ AvailablePersons

List<Person> Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AvailablePersons
get

List with all available Person objects.

Definition at line 149 of file PrepareRacesViewModel.cs.

◆ AvailableSwimmingStyles

List<SwimmingStyles> Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.AvailableSwimmingStyles
get

List with all available SwimmingStyles

Definition at line 173 of file PrepareRacesViewModel.cs.

◆ CalculateRacesVariantsCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CalculateRacesVariantsCommand
get

Command to calculate new RacesVariant variants.

Definition at line 308 of file PrepareRacesViewModel.cs.

◆ CleanupRacesCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CleanupRacesCommand
get

Command to cleanup all RacesVariant in RaceService.AllRacesVariants

Definition at line 388 of file PrepareRacesViewModel.cs.

◆ CopyRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CopyRaceVariantCommand
get

Copy the CurrentRacesVariant and add it as new variant to RaceService.AllRacesVariants

Definition at line 447 of file PrepareRacesViewModel.cs.

◆ CurrentRacesVariant

RacesVariant Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CurrentRacesVariant
getset

RacesVariant that is currently displayed on the view

Definition at line 71 of file PrepareRacesViewModel.cs.

◆ CurrentRacesVariantIsPersistent

bool Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CurrentRacesVariantIsPersistent
getset

Property wrapper for the RacesVariant.IsPersistent property of the CurrentRacesVariant.

This wrapper first disables the RacesVariant.IsPersistent property of all elements in AllRacesVariants and then sets the property of the CurrentRacesVariant

Definition at line 105 of file PrepareRacesViewModel.cs.

◆ CurrentVariantID

int Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.CurrentVariantID
getset

RacesVariant.VariantID of the CurrentRacesVariant Use 0 to select the RaceService.PersistedRacesVariant or the first element in AllRacesVariants if CurrentRacesVariant is null.

Use -1 to clear the current selection in the combobox

Definition at line 44 of file PrepareRacesViewModel.cs.

◆ HighlightedDistance

ushort Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.HighlightedDistance
getset

All PersonStart elements that match this distance will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Distance

Definition at line 215 of file PrepareRacesViewModel.cs.

◆ HighlightedGender

Genders Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.HighlightedGender
getset

All PersonStart elements that match this Genders will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Gender

Definition at line 197 of file PrepareRacesViewModel.cs.

◆ HighlightedPerson

Person Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.HighlightedPerson
getset

All PersonStart elements that match this Person will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.Person

Definition at line 155 of file PrepareRacesViewModel.cs.

◆ HighlightedSwimmingStyle

SwimmingStyles Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.HighlightedSwimmingStyle
getset

All PersonStart elements that match this SwimmingStyles will be highlighted if the HighlightPersonStartMode is HighlightPersonStartModes.SwimmingStyle

Definition at line 179 of file PrepareRacesViewModel.cs.

◆ HighlightPersonStartMode

HighlightPersonStartModes Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.HighlightPersonStartMode
getset

Currently active highlight mode.

Definition at line 132 of file PrepareRacesViewModel.cs.

◆ RemoveRaceVariantCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.RemoveRaceVariantCommand
get

Remove the CurrentRacesVariant from the RaceService.AllRacesVariants

Definition at line 416 of file PrepareRacesViewModel.cs.

◆ ReorderRaceVariantsCommand

ICommand Vereinsmeisterschaften.ViewModels.PrepareRacesViewModel.ReorderRaceVariantsCommand
get

Reorder the RacesVariant variants by score and then recalculate the variant IDs.

Definition at line 464 of file PrepareRacesViewModel.cs.


The documentation for this class was generated from the following file: