Page 1 of 2
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Fri Sep 21, 2018 1:18 pm
by wriedmann
Hello,
currently I'm working on the WPF library, and have encountered a problem: WPF does not provides a dialog to select a folder.
In my own WPF library, I'm using a Windows.Forms dialog.
I have now two possibilities:
- don't provide a folder selection method
- add a dependency to System.Windows.Forms
What do you prefer?
Wolfgang
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Fri Sep 21, 2018 2:07 pm
by Juraj
Hi Wolfgang
in my WPF app I use System.Windows.Forms.FolderBrowserDialog{}. Adding to a reference is not a problem.
I vote for option two.
Juraj
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Fri Sep 21, 2018 2:49 pm
by wriedmann
Hi Juraj,
ok, thank you very much!
1:0 for the dependency to System.Windows.Forms.
The alternative would be to write a WPF folder selection dialog....
Wolfgang
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Fri Sep 21, 2018 3:00 pm
by robert
Wolfgang,
https://github.com/aelij/WPFContrib has such a dialog.
I have no idea about the quality of code
Robert
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Fri Sep 21, 2018 3:37 pm
by wriedmann
Hi Robert,
thank you very much! I have looked at it, and it will take some time to isolate it. Currently this dialog crashes on my system.
Wolfgang
XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Sat Sep 22, 2018 7:51 am
by Guy Deprez
Re: XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Wed Sep 20, 2023 7:01 am
by kazmi
Hello,
When deciding whether to provide a folder selection method in your WPF library and considering the use of a Windows.Forms dialog or adding a dependency to System.Windows.Forms, it's essential to weigh the trade-offs and make a decision based on your library's goals and the user experience you want to provide.
Here are some factors to consider for each option:
Option 1: Don't Provide a Folder Selection Method
Pros:
Lightweight: Your library remains lightweight and doesn't introduce any external dependencies.
Consistency: Users who prefer a pure WPF experience may appreciate the consistency of using only WPF components.
Cons:
Limited Functionality: Users may need folder selection functionality, and not providing it could limit the utility of your library.
Option 2: Add a Dependency to System.Windows.Forms
Pros:
Complete Functionality: Adding the dependency allows you to offer folder selection, enhancing the usefulness of your library.
Minimal Effort: Leveraging the Windows.Forms dialog requires relatively little effort compared to creating a custom folder selection dialog.
Cons:
External Dependency: Introducing a dependency on System.Windows.Forms may not align with your library's design principles or goals, and some users may prefer not to include this dependency in their projects.
Inconsistency: Mixing Windows.Forms with WPF may create a less consistent user experience, as the dialog's appearance and behavior may differ from other WPF components.
Ultimately, the choice depends on your library's purpose and target audience. If offering folder selection is essential and aligns with your library's goals, adding the dependency to System.Windows.Forms might be the pragmatic choice. However, if you prioritize a lightweight, pure WPF experience, and folder selection is not a critical feature, you may opt to skip providing this functionality.
Consider providing clear documentation and instructions for users on how to handle folder selection if you choose not to include it in your library. Additionally, you could explore third-party WPF libraries or components that offer folder selection dialogs if you prefer to avoid introducing the System.Windows.Forms dependency.
source cartogeek.com
Re: XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Wed Sep 27, 2023 3:44 pm
by wriedmann
Hi Kazmi,
thank you for your thoughts!
Currently I have suspended the work on the library because there was not much interest in it, but that may change in the future if more X# users think that WPF is the way to go.
Wolfgang
Re: XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Wed Sep 27, 2023 6:24 pm
by FFF
Wolfgang,
if this dlg is the one, where one can ONLY select a folder, I wouldn’t miss it. In fact, I hate it, whenever an app forces me to use it…
Re: XSharp.Tools.WPF: dependency on System.Windows.Forms?
Posted: Wed Sep 27, 2023 6:51 pm
by wriedmann
Hi Karl,
please let pass my session in Memmingen, and we will see if there is any interest in a WPF X# GUI library. Maybe now the time could be right (but don't forget the XGUI classes - they promise the same development speed as the VO GUI classes, but based on Windows Forms).
Wolfgang