/// <summary> /// Initialises a new instance of the <see cref="SummaryEventViewModel"/> class. /// </summary> /// <param name="model">Current event model</param> public SummaryEventViewModel( IHandicapEvent model) : base(model.Summary) { this.eventModel = model; model.SummaryChangedEvent += this.ModelUpdated; }
/// <summary> /// View model which manages raw results view. /// </summary> /// <param name="handicapEventModel">junior handicap model</param> /// <param name="athletesModel">athletes model</param> /// <param name="commonIo">common IO manager</param> /// <param name="logger">application logger</param> public EventRawResultsViewModel( IHandicapEvent handicapEventModel, Athletes athletesModel, ICommonIo commonIo, IJHcLogger logger) { this.handicapEventModel = handicapEventModel; this.athletesModel = athletesModel; this.commonIo = commonIo; this.logger = logger; // Get the list of athletes registered for the current season from the Business layer. // This doesn't include the raw results, so read this directly from a file and add // to the the list. this.LoadRegisteredInformation(athletesModel.AthleteDetails); LoadRawEventResults(); this.canSaveImported = false; this.importedState = string.Empty; AddNewResultCommand = new SimpleCommand( this.AddRawTimeCmd, this.AddRawTimeCmdAvailable); SaveImportedResultsCommand = new SimpleCommand( this.SaveImportResults, this.CanSaveImported); SaveCommand = new SimpleCommand( this.SaveRawResultsCmd, this.SaveRawResultsCmdAvailable); ImportPositionsCommand = new SimpleCommand( this.ImportPositionDataDialog); ImportTimesCommand = new SimpleCommand( this.ImportTimesDataDialog); this.unregisteredAthletesIndex = -1; }
/// <summary> /// Initialises a new instance of the <see cref="ResultsTableViewModel"/> class. /// </summary> /// <param name="model">Junior handicap model</param> public ResultsTableViewModel( IHandicapEvent model) { this.model = model; this.resultsOrder = ResultsOrder.Default; model.ResultsChangedEvent += this.ModelResultsChanged; //model.CurrentSeason.CurrentEvent.ResultsCallback = new ResultsDelegate(this.PopulateResultsTable); ExpandCommand = new SimpleCommand( this.UpdateExpandedFlag); this.ResultsOrderBySpeedCommand = new SimpleCommand( this.OrderResultsBySpeed, this.CanOrderResultsBySpeed); this.ResultsOrderByTimeCommand = new SimpleCommand( this.OrderResultsByTime, this.CanOrderResultsByTime); this.PopulateResultsTable(); }