Ejemplo n.º 1
0
        private async void CombineVideo_OnClick(object sender, RoutedEventArgs e)
        {
            var vm = ((FrameworkElement)sender).DataContext as VideoInfoViewModel;

            if (vm != null)
            {
                var result = VideoSelectorWindow.Select(this.TryFindParent <Window>(),
                                                        vm.SeriesView, without: vm);
                if (!result.IsAccept)
                {
                    return;
                }
                var video = result.Value;
                if (video == null)
                {
                    return;
                }
                var manager = this.ViewModel.GetManagers().SeriesManager.GetVideoInfoManager(vm.SeriesView);
                var can     = await this.ViewModel.GetManagers().CanCombineAsync(manager, vm, video);

                if (!can.CanCombine)
                {
                    this.ShowJryVideoMessage("can not combine", can.Message);
                }
                else
                {
                    this.CombineConfirm(async() =>
                    {
                        await this.ViewModel.GetManagers().CombineAsync(manager, vm, video);
                    });
                }
            }
        }
Ejemplo n.º 2
0
        private void SelectLastVideoButton_OnClick(object sender, RoutedEventArgs e)
        {
            var result = VideoSelectorWindow.Select(this.TryFindParent <Window>(),
                                                    this.ViewModel.Parent,
                                                    without: this.ViewModel.GetCommitObject(),
                                                    defaultId: this.ViewModel.LastVideoViewModel?.Source.Id);

            if (result.IsAccept)
            {
                this.ViewModel.ChangeContextVideo(true, result.Value);
            }
        }