コード例 #1
0
        private void InitOnlineProjects()
        {
            OnlineProjects = new OnlineProgramsCollection();

            var project1 = new OnlineProgramHeader
            {
                ProjectName = "Online Project 1 with very very very very very long name",
                Description = "That is a nice description of Project 1. That is a nice description of Project 1. That is a nice description of Project 1"
            };

            var project2 = new OnlineProgramHeader
            {
                ProjectName = "Online Project 2",
                Description = "That is a nice description of Project 2."
            };

            var project3 = new OnlineProgramHeader
            {
                ProjectName = "Online Project 3",
                Description = "That is a nice description of Project 3."
            };

            OnlineProjects.Add(project1);
            OnlineProjects.Add(project2);
            OnlineProjects.Add(project3);
        }
コード例 #2
0
        private async void DownloadAction(OnlineProgramHeader programHeader)
        {
            lock (_importLock)
            {
                if (IsImporting)
                {
                    ServiceLocator.NotifictionService.ShowMessageBox(
                        AppResourcesHelper.Get("Main_OnlineProgramLoading"),
                        AppResourcesHelper.Get("Main_OnlineProgramDownloadBusy"),
                        CancelImportCallback, MessageBoxOptions.Ok);
                    return;
                }

                IsImporting = true;
            }

            var message = new GenericMessage <string>(programHeader.ProjectName);

            Messenger.Default.Send(message, ViewModelMessagingToken.DownloadProgramStartedListener);

            try
            {
                ServiceLocator.DispatcherService.RunOnMainThread(() =>
                                                                 ServiceLocator.NavigationService.NavigateBack <OnlineProgramViewModel>());

                ServiceLocator.ProgramImportService.SetDownloadHeader(programHeader);
                await Task.Run(() => ServiceLocator.ProgramImportService.TryImportWithStatusNotifications()).ConfigureAwait(false);
            }
            finally
            {
                ServiceLocator.DispatcherService.RunOnMainThread(() =>
                {
                    lock (_importLock) { IsImporting = false; }
                });
            }
        }
コード例 #3
0
 public void SetDownloadHeader(OnlineProgramHeader programHeader)
 {
     _onlineProgramHeader = programHeader;
     _programName         = _onlineProgramHeader.ProjectName;
 }
コード例 #4
0
 private void OnlineProgramTapAction(OnlineProgramHeader program)
 {
     SelectedOnlineProgram = program;
     ServiceLocator.NavigationService.NavigateTo <OnlineProgramViewModel>();
 }
コード例 #5
0
 private bool DownloadCommand_CanExecute(OnlineProgramHeader dataContext)
 {
     return(ButtonDownloadIsEnabled);
 }