コード例 #1
0
        private void _sources_Drop(object sender, DragEventArgs e)
        {
            VideoProjectVModel vm = this._view.DataContext as VideoProjectVModel;

            if (vm != null)
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                    vm.AddSources(files);
                }
            }
        }
コード例 #2
0
        private void _view_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            VideoProjectVModel vm = e.OldValue as VideoProjectVModel;

            if (vm != null)
            {
                vm.ViewUtil = null;
            }
            vm = e.NewValue as VideoProjectVModel;
            if (vm != null)
            {
                vm.ViewUtil = this;
            }
        }