Exemplo n.º 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            RoutedEventHandler onLoaded = null;

            onLoaded = (o, e) =>
            {
                explr.Loaded -= onLoaded;

                FileList2 filelist = explr.Template.FindName("PART_FileList", explr) as FileList2;

                _evm.RegisterDragAndDrop(filelist);

                DirectoryTree2 dirTree = explr.Template.FindName("PART_DirectoryTree", explr) as DirectoryTree2;
                _evm.RegisterDragAndDrop(dirTree);


                DataTemplate itemTemplate = explr.FindResource("EntryViewModel_DragDataTemplate") as DataTemplate;
                if (itemTemplate != null)
                {
                    _evm.RegisterDragTemplate(dirTree, itemTemplate);
                }
            };

            explr.Loaded += onLoaded;
        }
Exemplo n.º 2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            RoutedEventHandler onLoaded = null;

            onLoaded = delegate
            {
                explr.Loaded -= onLoaded;
                FileList2 fileList = explr.Template.FindName("PART_FileList", explr) as FileList2;
                fileList.ViewMode = ViewMode.vmExtraLargeIcon;
                _evm.RegisterDragAndDrop(fileList);
            };
            explr.Loaded += onLoaded;
        }