Conversation
|
The naming here sounds a little bit too similar to Maybe |
Good point! I haven't done a deep dive into this topic yet, but according to #1197 some of the existing language results in unexpected behavior and may benefit from improvement. I'm not totally sold on I agree with you EDIT: perhaps |
|
@bclehmann what do you think of the new API and demos? Are you up for making the Avalonia demo or do you want me to do that? I'm cool either way |
|
I don't mind doing it for Avalonia but I can't do it tonight. If you've already written a WPF version it's normally trivial to turn that into Avalonia, so it's not much work either way. |
|
I like the API, it looks like you avoided splitting it up into different functions for disabling zoom and pan. I wonder if disabling pan but not zoom is a common usecase, if someone had a plot that was only drawn from x1 to x2 panning outside of that range is not useful. It seems like that usecase would be better served by something like As for the demo, it seems fine, we mostly avoid MVVM elsewhere, I don't know if that was intentional or not? It is more WPF-ey, and I don't think it should be confusing to new people. |
|
Thanks for your feedback @bclehmann!
I left the door open to possibly implement more similar functions later:
It usually is the result of making the demo first for WinForms then copy/pasting to realize the same effect in WPF as a code-behind. Admittedly demos that use designs idiomatic to each platform would be better, but are a little more work to create.
No rush! If you're up for making the Avalonia demo that would be great. I can leave this PR open so you can create a PR into this branch, or I can merge this one into master and you can make a new branch/PR when you want - let me know what sounds good to you. You're welcome to copy the WPF design (code-behind) or do something more idiomatic for Avalonia if you want to get fancy! |
|
I made a PR. It's fairly similar to the WPF version. #1215 |
Demo (Avalonia): Multi-Axis Lock
This PR adds methods to lock axes to prevent them from being panned/zoomed. Solves #1179