private async Task ChangePanelCommandExecutionAsync(object parameter)
        {
            var panelType = (string)parameter;

            switch (panelType)
            {
            case "calendar":
            {
                await _navigationService.ChangePanelAsync(typeof(CalendarPanel.CalendarPanel));

                break;
            }

            case "activities":
            {
                await _navigationService.ChangePanelAsync(typeof(ActivitiesPanel.ActivitiesPanel));

                break;
            }

            default:
            {
                throw new ArgumentException($"Panel of type {panelType} is not implemented.");
            }
            }
        }
Example #2
0
        private async Task LoadDayRecord()
        {
            if (_temporaryApplicationValues.DayRecordIdToOpen.HasValue == false)
            {
                throw new Exception("No day record id found to open day record panel.");
            }

            var getDayRecordQuery       = new GetDayRecordForDayRecordPanelById(_temporaryApplicationValues.DayRecordIdToOpen.Value);
            var getDayRecordQueryResult = await _dispatcher.DispatchQueryAndGetResultAsync <DayRecordForDayRecordPanel, GetDayRecordForDayRecordPanelById>(getDayRecordQuery);

            if (getDayRecordQueryResult.Successful == false)
            {
                await _navigationService.ChangePanelAsync(typeof(CalendarPanel.CalendarPanel));
            }

            DayRecord = getDayRecordQueryResult.Result;
            RaisePropertyChanged(nameof(DayRecord));
        }