Clear Pull Request Form when canceled or completed. #523
Clear Pull Request Form when canceled or completed. #523
Conversation
| private set; | ||
| } | ||
|
|
||
| public ICommand Reset |
There was a problem hiding this comment.
I had to the option to remove or hide this with new, I decided to remove it since this was not in use anywhere,
2696454 to
35d1a98
Compare
| } | ||
|
|
||
| public override void Reset() | ||
| { |
|
So to avoid adding the
|
29bdb09 to
c0c6fa8
Compare
| var vm = pair.ViewModel as IResettable; | ||
| //TODO:Can I even do this? | ||
| //vm?.Reset(); | ||
| vm?.Reset(); |
There was a problem hiding this comment.
This seems like a handy C# 6 thing! What I'm doing here is using the null conditional operator to speculate that the VM could be a member of IResettable and to access Reset() if it is, so if vm is null, and the operator avoids a null reference exception
There was a problem hiding this comment.
Yup, this is a very handy thing indeed!
|
@paladique I forget, did we figure out why these tests fail in CI? Do they pass in Visual Studio? |
4e3cbf8 to
2271bb2
Compare
|
@shana ran the tests in VS and it's failing on the new test added for the Should I be mocking IResettable in some way? That seems unnecessary because |
|
Oh! Yes, you need to mark the viewmodel as You need to do it for the viewmodel in the |
|
This was mostly an exploratory PR, so closing for now! |
Fixes #479
Instead subscribing to the cancel and completion actions of the PullRequestCreation view model,
ResetViewModel()was added toIViewModelthat will execute the VMs overriddenBaseViewModel'sReset(),