-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Port ColorPicker control from WinUI #72
Comments
Thank you for the suggestion. The WinUI ColorPicker has been on my radar for a while, and will be one of the priorities post v0.9 release. |
@Kinnara just for case, I started working on that ColorPicker from WinUI, but for Avalonia. |
@maxkatz6 As mentioned, I'm doing a port for the Uno Platform too. Will make sure to check against your code base for inconsistencies. This would be another candidate for a base version of a WPF port. Separately... We will have 3 different C# versions of the control: Avalonia, WPF, Uno Platform. We probably need to get creative on automating changes so the port from C++ to C# occurs once and then the small changes for the various C# flavors (Avalonia/WPF) get applied on top of a pure UWP port. |
Hey @robloo and @maxkatz6, that's awesome people! Porting from either UWP/WinUI/Uno platform (c++/C#) will be relatively easier than from Avalonia (since it has a different styling system than previous). If you did the Uno platform part, it will be much easier to work on (just UWP to WPF, I have done some porting WCT controls and I have some experience on that). But porting directly from WinUI (c++) will be the best option (IMO, since you will do platform specific code for Avalonia/Uno platform. You may have to do some fills and stuffs). It will be more consistent with the official one (@Kinnara is skilled in that subject). @robloo, The new color picker button you made for WCT could be added to the ModernWpfCommunityToolkit. The author of this lib and you both could interact and share your work together to port it from c++ to C# (I see @maxkatz6 already did the work for Avalonia but the implementation will be specific to Avalonia and if @robloo did it for Uno platform it will be a different strain of it). I watch your contributions on github and I have to admit that I'm a fan of you all 😁. |
I think the hardest part is actually porting from C++ to C#. There will be two versions to choose from soon though: Uno or Avalonia. In developing for Uno I am also going to make a stand-alone version that runs on UWP. That is probably the easiest to use for the WPF base. So bottom line, both @maxkatz6 and I will have ported directly from C++ to C#. I certainly wouldn't recommend going through that work again. It is by far easier to just update the styling from Avalonia or, even easier, to make the transition from UWP. The ColorPickerButton isn't quite stable yet. Definitely would be great to see this in WPF though! Happy to help when the time comes. |
A big thank you to you all. I'm not sure if there are license issues porting from Uno, but porting from Avalonia should be possible. It's definitely fastest to port from another C# code base, while @ShankarBUS's point about consistency with WinUI is also valid. We may try a compromise: porting the platform-specific part from WinUI, and the rest from Avalonia. Anyhow, I believe it's time to start the work. It likely won't be super fast due to a lot of personal matters, but shouldn't take too long either thanks to the work you guys have done. |
@Kinnara As the author of the ColorPicker port in Uno, I would be happy to provide you a zip file of the code licensed as MIT. My initial port was a conversion straight to C# as a stand-alone project to make sure things worked. Then I put it into Uno. I can give you the original C# code after I clean it up a bit. As the author its (1) within my power to license this as MIT (2) this version of the code would pre-date the one given to Uno under the Apache license. |
@robloo That's very kind of you! My email is [email protected] if you prefer to send it that way. Thank you again. |
@Kinnara I have no problem sharing the code here! I just didn't want to create a new repo for this. I've packaged up all the code and made some updates where appropriate. Please note the following:
Overall, this is a very-close port of the WinUI version of the color picker and I only deviated where there was no other choice. The directory/class structure also very closely follows the WinUI code base. @maxkatz6 Port is very good/high-quality though and I referenced it to double check a few things. The only benefits of using this is it more closely matches WPF since it is written in UWP. I also recommend reading this: https://github.com/microsoft/microsoft-ui-xaml/blob/308e4b551d05a87eb10d674d4b1feb8e34ba0111/dev/ColorPicker/readme.md If you have any questions feel free to ask! I'm sure one of us can save you some time if you run into troubles. Otherwise, you are doing a lot of great work here. I would certainly use your project if I was using WPF more often these days. Stay safe and I hope all will be well soon! License: MIT (code base authored by myself before contributing a later iteration of it to Uno) |
@robloo Really grateful for the source code and all the notes/advice/additional information. I've heard someone say that the greatest respect for food is to cook them as delicious as possible, and I believe this also applies to the help you and others have provided. |
Any updates @Kinnara? It's been more than a month 😅. I understand that you have other things to focus on. Just give us some information on this, please? |
Work has started but going slowly due to limited time. Starting next week I expect to have a little (literally) more free time. Let's set a deadline at the end of November and try to hit it! |
@robloo nice to see you over here as well. How is the progress with color picking controls for Avalonia? |
Might be best to talk about that over on the Avalonia github issue. @maxkatz6 has the Avalonia port so he will have to provide an update. We both ended up porting separately from c++ to c#. UWP and Avalonia have enough differences, and the UWP port needs to maintain very high code similarity with WinUI especially for Uno (in order to keep fixes/updates synced). My offer stands to contribute the ColorPickerButton modifications done for the Windows community toolkit if/when Avalonia is ready though. |
@MelbourneDeveloper I pushed my ColorPicker, that ported from WinUI, to the NuGet. You can see source code here: It lacks some docs/readme/ci, but works properly as far as I tested. Also there is another color picker controls for Avalonia: |
There are some cases where a user wants to change or choose a color(let's say the accent color of our apps, foreground color of a text control, etc.), in such cases we are demanded to provide a control for that. But the tranditional win32 color picker controls(eg. ColorDialog from WinForms) are out-of-date.
[ColorDialog from WinForms]
We can use other libs (wpftoolkit for instance) for that but we need a ColorPicker with Fluent UI.
It would be great if you can port it from WinUI
[ColorPicker from WinUI]
This will enable a much more consistent environment for our apps.
The text was updated successfully, but these errors were encountered: