Skip to content

Conversation

@mjkkirschner
Copy link
Member

Purpose

http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-10495

1 - This PR adds another command to the DynamoViewModel - OpenIfSaved command which wraps a DynamoModel OpenFileCommand with a check for unsaved changes on the home workspace. If there are unsaved changes the message box requesting a save is popped up.


2 - This task also requested exploring a property exposing the modal state of the Dynamo UI - I.E, are there any windows open that would disallow interactions with the DynamoModel.

the best I have found is the static class ComponentDispatcher.EnterThreadModal event which would allow us to set a bool flag somewhere on the view or view model. Unfortunately message boxes(without owners) do not fire this event so a scan over all message box and other popup / window code would need to be done and consequences of this would need to be tested.

 System.Windows.Interop.ComponentDispatcher.EnterThreadModal += (o,e) {modal = true;}

I would guess this handler would be set at view model or view construction time. Looking for thoughts and feedback on this, note this PR does not include this handler.

For now, I will leave this property as a followup task if deemed necessary

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.

Reviewers

@ramramps
@sharadkjaiswal

FYIs

@kronz @BogdanZavu

Michael Kirschner and others added 3 commits August 16, 2016 22:32
add test
add test to proj
add viewModel test
@mjkkirschner mjkkirschner added the PTAL Please Take A Look 👀 label Aug 19, 2016
NodeFromSelectionCommand = new DelegateCommand(CreateNodeFromSelection, CanCreateNodeFromSelection);
}

public DelegateCommand OpenIfSavedCommand { get; set; }
Copy link
Collaborator

@ramramps ramramps Aug 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this attached to XAML?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

@ramramps
Copy link
Collaborator

LGTM.

@ramramps ramramps added LGTM and removed PTAL Please Take A Look 👀 labels Aug 19, 2016
@mjkkirschner
Copy link
Member Author

I'm going to merge this in - @BogdanZavu please test this API and let us know if it does what you need.

@mjkkirschner mjkkirschner merged commit c5d107f into DynamoDS:master Aug 21, 2016
@BogdanZavu
Copy link
Contributor

Thank you @mjkkirschner , @ramramps . I'll test it tomorrow and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants