public FolderOpenControl()
        {
            var foc = new FolderOpenCommand();

            this.SetValue(FolderOpenCommandProperty, foc);

            foc.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Directory")
                {
                    this.Dispatcher.InvokeAsync(() => Path = foc.Directory,
                                                System.Windows.Threading.DispatcherPriority.Background, default(System.Threading.CancellationToken));
                }
            };
        }
예제 #2
0
        public FolderOpenControl()
        {
            var foc = new FolderOpenCommand();

            this.SetValue(FolderOpenCommandProperty, foc);
            Uri resourceLocater = new Uri("/UtilityWpf.View;component/Themes/FolderOpenControl.xaml", System.UriKind.Relative);
            ResourceDictionary resourceDictionary = (ResourceDictionary)Application.LoadComponent(resourceLocater);

            Style = resourceDictionary["FolderOpenControl"] as Style;

            foc.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Directory")
                {
                    this.Dispatcher.InvokeAsync(() => Path = foc.Directory,
                                                System.Windows.Threading.DispatcherPriority.Background, default(System.Threading.CancellationToken));
                }
            };
        }