diff --git a/src/DynamoCoreWpf/ViewModels/PackageManager/PackagePathViewModel.cs b/src/DynamoCoreWpf/ViewModels/PackageManager/PackagePathViewModel.cs index 6217b242e24..ee49fdbff34 100644 --- a/src/DynamoCoreWpf/ViewModels/PackageManager/PackagePathViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/PackageManager/PackagePathViewModel.cs @@ -162,6 +162,8 @@ private void SwapPath(int x, int y) var tempPath = RootLocations[x]; RootLocations[x] = RootLocations[y]; RootLocations[y] = tempPath; + + RaiseCanExecuteChanged(); } private void InsertPath() diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 1dd15768238..f957481fe39 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -737,7 +737,7 @@ ToolTip="{Binding Path=SelectedPackagePathForInstall}"> - + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 877d8ec3781..9f24300ea7c 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -86,6 +86,7 @@ private void CloseButton_Click(object sender, RoutedEventArgs e) Actions.Close, Categories.Preferences); viewModel.PackagePathsViewModel.SaveSettingCommand.Execute(null); + PackagePathView.Dispose(); Close(); } diff --git a/src/DynamoCoreWpf/Views/PackageManager/PackagePathView.xaml.cs b/src/DynamoCoreWpf/Views/PackageManager/PackagePathView.xaml.cs index c87c1c00d70..b4580e413d2 100644 --- a/src/DynamoCoreWpf/Views/PackageManager/PackagePathView.xaml.cs +++ b/src/DynamoCoreWpf/Views/PackageManager/PackagePathView.xaml.cs @@ -29,14 +29,9 @@ public PackagePathView() DataContextChanged += PackagePathView_DataContextChanged; } - internal PackagePathView(PackagePathViewModel viewModel) + internal void Dispose() { - if (viewModel == null) - throw new ArgumentNullException("viewModel"); - - InitializeComponent(); - this.DataContext = viewModel; - viewModel.RequestShowFileDialog += OnRequestShowFileDialog; + ViewModel.RequestShowFileDialog -= OnRequestShowFileDialog; } #endregion