-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
Feature proposal: Gauge Control #909
base: main
Are you sure you want to change the base?
Conversation
Added a reference to the new 'Gauge' control.
Added a custom 'Gauge' control for displaying values.
Added a default control and style template for the 'Gauge' control.
Increased default thickness
Added FrameworkPropertyMetadataOptions.AffectsRender for Content and Header property
@ElectroAttacks If you resize the control what does the gauge do? Does it resize correctly? |
Well, the default template for the Gauge includes a Data binding that ensures symmetrical resizing. If the control is resized it will be redrawn based on the new location and size, like a normal control will do. The Arc control inherits from a shape, which can lead to weird behavior if you stack two of them and perform any resizing. That's one of the reasons the Gauge control is derived from the RangeBase class. |
@ElectroAttacks Well the arc couldn't do that, at least in 2.1. That's why i'm asking. |
@m0lDaViA This is exactly what I figured out. I reported that issue a few months ago and fixed it myself... I'm already working on splitting the logic of the Gauge control into a base class and two controls, so it will be structured like so:
But that might take a while due to the complexity of the Angular Gauge. I want a kinda similar experience than the one in Livecharts 2... For the Arc itself it might be easier to figure out why a size change does not affect render by default, maybe it would be enough to override it's MetaData to enable the redrawing... |
@ElectroAttacks As i wanted to create a knob control myself i was thinking about fixing the arc. |
@m0lDaViA Well, I had some ideas that might fix the issue where the arc is not being redrawn after a resize, if you are talking about that issue. |
I'm still not sure if these types of controls should be in the main package or if it would be better to create a new one, like Wpf.Ui.Diagrams or something like that |
@pomianowski Well, yeah it would make maintenance a little bit easier... I would prefer Wpf.Ui.Graphs though. |
@pomianowski |
For your information: the arc class does resize now correctly. Maybe you can work with that now? |
@m0lDaViA , @pomianowski The more controls I'm using the more bugs I find... For example if you're using the FontIcon control with a symbol font like Material Symbols (newer version of Material Icons) and try to set a font size, it won't be applied. You have to change it multiple times at runtime to change the font size. The other bug I've found is that when you're actually using the attached property NavigationView.HeaderContent dynamically, it will not work as expected. Because by default the Header Content is updated without re - rendering. So you need to navigate back and forth multiple times to get the header content right, or, the way I fixed it for myself is using an IMessenger and bind to the VM. It will be easier to maintain everything by removing controls like IconSource, FontIcon, FontIconSource etc., because you can simply use the default controls for that. Another thing that might save a lot of work would be changing the NavigationHeader/ Icon Properties to object type. This will make it more dynamic and user friendly... |
You mean that?: #1067
In that case we need InvalidateVisual.
Well i don't know exactly why he wrote Icons the way he did. I mean FontIcon, SymbolIcon and ImageIcon are fine but why does it need like 20 separated classes for that all? It like the appearance part. There are way too many classes and methods spread across. |
For displaying a symbol font you can basically just use a Testblock or the ui:TextBlock. The only reason why the FontIcon exists is the constraints for the MenuItems... If we really need the constraint we could just add an common interface for SymbolIcon and TextBlock, otherwise I would change the MenuItems to have a Header and Footer Property of type object, so each user can decide himself.
Actually I think it might be this part here:
We are not inheriting from TextElement, so why are we adding an owner to it's FontSizeProperty? Doesn't make sense, right?
The SymbolIcon is fine, but ImageIcon and FontIcon are controls providing the same behavior as default XAML controls. |
I guess he did that so you can use SymbolIcons, FontIcons and Images as Icons.
Overall i think there are a lot of parts which need to be rewritten. |
Yeah, that's basically what I was trying to say, but it will still be easier to use object and add an default style...
Well, I would love to help you guys, there are some things I wanna fix myself, but I would discuss that first... Haha |
@ElectroAttacks Then, hop on https://discord.gg/wrYuX59H |
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information