FantasticFiasco / mvvm-dialogs

Library simplifying the concept of opening dialogs from a view model when using MVVM in WPF
Apache License 2.0
646 stars 76 forks source link

Customizing FolderBrowser, Open, Save, Message Dialogs #30

Closed pdinnissen closed 6 years ago

pdinnissen commented 6 years ago

Would you be open to extending your DialogService to have a FrameworkDialog Factory/Interface that provides which FolderBrowser, Open, Save, MessageBox dialogs get used?

I really like this dialog service, but would like to combine it with Ookii dialogs or other dialogs provided other third parties.

I'm willing to do a pull request if you are open to the idea.

pdinnissen commented 6 years ago

I've put together a sample in this fork.

I've updated the FolderBrowser Demo accordingly to use the Ookii dialog.

I'm sorry that I haven't followed the proper committing conventions, I just wanted to quickly get some type of Proof of Concept going.

I haven't touched the MessageBox, but that could be easily added in. I'm also sure some of the changes I've done could also be improved a bit.

FantasticFiasco commented 6 years ago

Hi pdinnissen and welcome to the project!

I would also think that to be a good idea, MVVM Dialogs already support custom dialogs, but it would have to be implemented in a way that doesn't get in the way of the mainstream implementation.

I haven't looked at your fork yet, but will probably get to it in a couple of hours, and I would happily accept pull requests. We can work together on it if you would like. In that case permit me push rights to the fork.

pdinnissen commented 6 years ago

I believe I've given you the necessary rights.

I think some bit of collaboration would yield the best result. I believe my sample doesn't touch the mainstream implementation and is also a non-breaking change. Everything is under the hood and a few new DialogService constructors for all the new permutations.

FantasticFiasco commented 6 years ago

I'm going to create new demo projects that focus on the custom framework dialogs, so I'll be moving the code you've added to the project Demo.FolderBrowserDialog. Do you have any pending changes in the demo application that you would like to commit before I begin?

pdinnissen commented 6 years ago

No. That's as far as I got. A new demo makes sense.

FantasticFiasco commented 6 years ago

Do you have VS2017 installed? I would like to convert solution to VS2017, but won't if you are running VS2015.

I'm currently making some minor changes that isn't related to your feature request, but would like to do them anyway. Hope you don't mind.

When we're finished you should squash all commits, claiming them as your own, and be a part of the commit history of this project.

pdinnissen commented 6 years ago

Yes. 15.4.

Sent from my Windows 10 phone

From: Mattias Kindborg @FantasticFiasco Sent: December 6, 2017 4:41 PM To: FantasticFiasco/mvvm-dialogs Cc: pdinnissen; Author Subject: Re: [FantasticFiasco/mvvm-dialogs] Customizing FolderBrowser, Open,Save, Message Dialogs (#30)

Do you have VS2017 installed? I would like to convert solution to VS2017, but won't if you are running VS2015. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

FantasticFiasco commented 6 years ago

I've caught a nasty bug and might be out a couple of days, but these are the things I plan to commit before we create the pull request and merge back:

pdinnissen commented 6 years ago

I read that too quickly the first time. I thought you found a nasty bug in my recommendation. Feel better and there's no need to rush this pull request.

I didn't do the code for custom MessageBox, so that needs to be added as well. Let me know if you'd like for me to put that together.

On Thu, Dec 7, 2017 at 1:27 PM, Mattias Kindborg @FantasticFiasco < notifications@github.com> wrote:

I've caught a nasty bug and might be out a couple of days, but these are the things I plan to commit before we create the pull request and merge back:

  • Review MVVM Dialog changes
  • Custom folder browser dialog
    • Add demo application
    • Fix tests
  • Custom open file dialog
    • Add demo application
    • Add tests
  • Custom save file dialog
    • Add demo application
    • Add tests
  • Custom message box
    • Add demo application
    • Add tests
  • Update CHANGELOG.md

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FantasticFiasco/mvvm-dialogs/issues/30#issuecomment-350053360, or mute the thread https://github.com/notifications/unsubscribe-auth/ALefn8KS802oWVhjpY-yMMP0Rxdt3WdFks5s-C38gaJpZM4Q3_QD .

FantasticFiasco commented 6 years ago

lol yea that was a poor choice of words, no bugs found in your code!

FantasticFiasco commented 6 years ago

I think the code is ready for a pull request now.

Can you squash all commits into a single one with the commit message of my final commit, and then create the pull request?

Thanks for the contribution, it's an important one!

pdinnissen commented 6 years ago

I couldn't find the option to squash the commits. Maybe that only appears when actually merging?

On Mon, Dec 11, 2017 at 3:56 AM, Mattias Kindborg @FantasticFiasco < notifications@github.com> wrote:

I think the code is ready for a pull request now.

Can you squash all commits into a single one with the commit message of my final commit, and then create the pull request?

Thanks for the contribution, it's an important one!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FantasticFiasco/mvvm-dialogs/issues/30#issuecomment-350660600, or mute the thread https://github.com/notifications/unsubscribe-auth/ALefn6DovHfs4VYWoVUFcxVm1ivJZDJ2ks5s_O4qgaJpZM4Q3_QD .

FantasticFiasco commented 6 years ago

I'll lead you through it, but let me start. Until I say so, don't pull or fetch your fork.

FantasticFiasco commented 6 years ago

We're ready to get to work. We're doing this because I would like you to get credit for the work you've done.

The first thing for you to do is to reset your history. The git commit history has changed because I've squashed all our commits into a single one.

Run the following commands in a prompt of your choice:

git fetch
git reset --hard origin/master

The next thing for you to do is to claim the last commit as your own. According to this question you should now run:

git rebase -i HEAD~1

and when vim is opened you should enter edit mode by pressing the i key, navigate to the commit using the arrow keys and change pick to edit. You then exit the edit mode using Esc, and then type :wq to write to disk and quit.

You will at this point be able to change the author. Type the following in the command prompt:

git commit --amend --author="Author Name <email@address.com>"

where you replace the name and e-mail address with the one you've configured git to use.

You are then ready to continue the rebase by running the following command:

git rebase --continue

When the rebase is done, push your changed history to GitHub by running the following command:

git push --force

And then you are done! You've claimed responsibility for all the changes on your fork.

If you run into any trouble, please let me know and I will try to help you.

pdinnissen commented 6 years ago

great instructions.

I think I've completed them.

I appreciate you wanting to give me credit, but to be honest you did do most of the work and it's your library. I'm just happy to have given a good idea to make it better for other's to use (I'm assuming other's also hate the default folder browser from Windows as much as I do.)

On Mon, Dec 11, 2017 at 1:31 PM, Mattias Kindborg @FantasticFiasco < notifications@github.com> wrote:

We're ready to get to work. We're doing this because I would like you to get credit for the work you've done.

The first thing for you to do is to reset your history. The git commit history has changed because I've squashed all our commits into a single one.

Run the following commands in a prompt of your choice:

git fetch git reset --hard origin/master

The next thing for you to do is to claim the last commit as your own. According to this question https://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit you should now run:

git rebase -i HEAD~1

and when vim is opened you should enter edit mode by pressing the i key, navigate to the commit using the arrow keys and change pick to edit. You then exit the edit mode using Esc, and then type :wq to write to disk and quit.

You will at this point be able to change the author. Type the following in the command prompt:

git commit --amend --author="Author Name email@address.com"

where you replace the name and e-mail address with the one you've configured git to use.

You are then ready to continue the rebase by running the following command:

git rebase --continue

When the rebase is done, push your changed history to GitHub by running the following command:

git push --force

And then you are done! You've claimed responsibility for all the changes on your fork.

If you run into any trouble, please let me know and I will try to help you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FantasticFiasco/mvvm-dialogs/issues/30#issuecomment-350814369, or mute the thread https://github.com/notifications/unsubscribe-auth/ALefn-Xq48qMF35ERBzG_sI4guhFtI6Oks5s_XT0gaJpZM4Q3_QD .

FantasticFiasco commented 6 years ago

A new version is now live on nuget.org