Пример #1
0
 private void OpenSelectPresentationFileDialog()
 {
     OpenSelectFileDialog(DemoType.Presentation, "PPT File(*.ppt;*.pptx;*.avi;*.mp4;*.mkv;*.wav;*.flv;*.asf;)|*.ppt;*.pptx;*.avi;*.mp4;*.mkv;*.wav;*.flv;*.asf;",
                          (selectedFileFullName) =>
     {
         LoadPresentationItem();
         SetSelectedPresentationItem(PresentationList, (presentation) =>
         {
             CurrentSelectedPresentation = presentation;
         }, (item) => item.Presentation.FileFullPath == selectedFileFullName);
     });
 }
Пример #2
0
 private void SetSelectedPresentationItem(List <PresentationItemViewModel> sourceList, Action <PresentationItemViewModel> callback, Func <PresentationItemViewModel, bool> where = null)
 {
     if (sourceList.Any())
     {
         PresentationItemViewModel presentation = sourceList.First();
         if (where != null)
         {
             presentation = sourceList.First(where);
         }
         callback.Invoke(presentation);
     }
 }
Пример #3
0
        public PresentationViewModel(PresentationsRepository presentationsRepository, IEventAggregator eventAggregator)
        {
            _eventAggregator         = eventAggregator;
            _presentationsRepository = presentationsRepository ?? throw new ArgumentNullException("presentationsRepository");

            OpenSelectPresentationFileWindow = new DelegateCommand(OpenSelectPresentationFileDialog);
            OpenSelectWarmVideoFileWindow    = new DelegateCommand(OpenSelectWarmVideoFileDialog);

            LoadPresentationItem();
            LoadWarmVideoItem();

            SetSelectedPresentationItem(PresentationList, (presentation) =>
            {
                CurrentSelectedPresentation = presentation;
            });
            SetSelectedPresentationItem(WarmVideoList, (presentation) =>
            {
                CurrentSelectedWarmVideo = presentation;
            });
        }