Skip to content

Commit

Permalink
Packagepaths issues (#11793)
Browse files Browse the repository at this point in the history
* small adjustment

* align titles

* add names to buttons for ui automation tests

* missing button name

* add dispose to packagepathview
remove unused constructor
raise can execute change when paths are shifted to update icons
give pathview a name
dispose package paths on prefs window close

Co-authored-by: michael kirschner <[email protected]>
  • Loading branch information
mjkkirschner and mjkkirschner authored Jun 25, 2021
1 parent 56fc0bd commit 56b9e57
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@
ToolTip="{Binding Path=SelectedPackagePathForInstall}">
</ComboBox>
<ScrollViewer Height="200" VerticalScrollBarVisibility="Auto">
<packagemanager:PackagePathView DataContext="{Binding PackagePathsViewModel}"/>
<packagemanager:PackagePathView x:Name="PackagePathView" DataContext="{Binding PackagePathsViewModel}"/>
</ScrollViewer>
</StackPanel>
</Expander>
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private void CloseButton_Click(object sender, RoutedEventArgs e)
Actions.Close,
Categories.Preferences);
viewModel.PackagePathsViewModel.SaveSettingCommand.Execute(null);
PackagePathView.Dispose();
Close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56b9e57

Please sign in to comment.