Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface IDynamoViewModel : INotifyPropertyChanged
public partial class DynamoViewModel : ViewModelBase, IDynamoViewModel
{
#region properties

public Window Owner { get; set; }
private readonly DynamoModel model;
private Point transformOrigin;
private bool showStartPage = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private void Uninstall()
if (Model.LoadedAssemblies.Any())
{
var resAssem =
MessageBoxService.Show(string.Format(MessageNeedToRestart,
MessageBoxService.Show(dynamoViewModel.Owner,string.Format(MessageNeedToRestart,
dynamoViewModel.BrandingResourceProvider.ProductName),
MessageNeedToRestartTitle,
MessageBoxButton.OKCancel,
Expand All @@ -280,7 +280,7 @@ private void Uninstall()

if (!Model.BuiltInPackage)
{
var res = MessageBoxService.Show(String.Format(Resources.MessageConfirmToDeletePackage, this.Model.Name),
var res = MessageBoxService.Show(dynamoViewModel.Owner,String.Format(Resources.MessageConfirmToDeletePackage, this.Model.Name),
Resources.MessageNeedToRestartAfterDeleteTitle,
MessageBoxButton.YesNo, MessageBoxImage.Question);

Expand All @@ -296,7 +296,7 @@ private void Uninstall()
}
catch (Exception)
{
MessageBoxService.Show(string.Format(MessageFailedToDeleteOrUnload,
MessageBoxService.Show(dynamoViewModel.Owner,string.Format(MessageFailedToDeleteOrUnload,
dynamoViewModel.BrandingResourceProvider.ProductName),
MessageFailedToDeleteOrUnloadTitle,
MessageBoxButton.OK, MessageBoxImage.Error);
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public partial class PreferencesView : Window
public PreferencesView(DynamoView dynamoView)
{
dynViewModel = dynamoView.DataContext as DynamoViewModel;

SetupPreferencesViewModel(dynViewModel);

DataContext = dynViewModel.PreferencesViewModel;
Expand All @@ -46,6 +47,7 @@ public PreferencesView(DynamoView dynamoView)
Categories.Preferences);

Owner = dynamoView;
dynViewModel.Owner = this;
if (DataContext is PreferencesViewModel viewModelTemp)
{
viewModel = viewModelTemp;
Expand Down
2 changes: 1 addition & 1 deletion test/DynamoCoreWpfTests/PackageManagerUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public void PackageManagerUninstallCommand()
Assert.AreEqual(1, loader.LocalPackages.Count());

var dlgMock = new Mock<MessageBoxService.IMessageBox>();
dlgMock.Setup(m => m.Show(It.IsAny<string>(), It.IsAny<string>(), It.Is<MessageBoxButton>(x => x == MessageBoxButton.OKCancel || x == MessageBoxButton.OK), It.IsAny<MessageBoxImage>()))
dlgMock.Setup(m => m.Show(It.IsAny<Window>(), It.IsAny<string>(), It.IsAny<string>(), It.Is<MessageBoxButton>(x => x == MessageBoxButton.OKCancel || x == MessageBoxButton.OK), It.IsAny<MessageBoxImage>()))
.Returns(MessageBoxResult.OK);
MessageBoxService.OverrideMessageBoxDuringTests(dlgMock.Object);

Expand Down