Thanks for watching! I recently started an email "Newsletter" that I'm going to send weekly, describing what types of things I'm studying and resources I found useful for programming and machine learning. If that sounds useful to you, here ya go! - programmingwithchris.substack.com/ 🕘Timestamps: 00:00 - Video Start 00:32 - Demoing the Meter Drawables 02:01 - Showing How it Works in the XAML and Code Behind in .NET Maui 06:37 - The Linear Meter Drawable 12:59 - The Radial Gauge Drawable
Great video thanks for sharing. Math is always the hardest part of development, I always struggle with that too. As for the 2 circles for the round dial you could have used canvas.DrawArc() - then you wouldn't need to clip that triangle area.
Great video. What would it take to take this example a step further and make a standalone reusable component. Seems like this was not included but might be an idea for another video.
Yup! I've been thinking about the best way to do that lately, and am a little closer on some drawn controls I've made for my "ShoppingList" app. So I'll show that off in the next vid. And if I get enough of these together, i'd probably throw it in a class library or something, for reuse.
@@ProgrammingWithChris Is there an equivalent to WPF user controls in Maui? I think James M partially goes over some of this in: ua-cam.com/video/TkadU_OfmIE/v-deo.html . Your example uses graphics, so it’s different. I haven’t seen any Maui videos on making a graphical custom user control and then reusing that in another project. Just an idea. Thanks
Ah, yeah, that’s definitely one way you can do that, if you’re using existing controls. The path I’ve been going down is to create a class that inherits from, say, GraphicsView, and the you can creat custom properties and change the behavior any way you can, and then to use the new control you just use it’s name in the XAML. Fairly clean, so far, though I’ve run into a few tricky things with it. Will talk through it in the next vid.
Sure, yeah, you can do that, though I suspect there are some libraries out there that would be easier to use than drawing your own. But yeah, definitely!
Hi, pretty nice demo... Have you tried to apply the IDrawable objects to an MVVM pattern - in the sense of changing values via properties? I'm kinda struggling creating bindable properties AND invalidating the view with updated properties. I can invalidate things via the code behind; but then the whole MVVM approach is kinda... well...
The example project does not work on Windows. It crashes with exception "After calling CanvasDrawingSession.CreateLayer, you must close the resulting CanvasActiveLayer before ending the CanvasDrawingSession." which is caused by the canvas.ClipPath(path); statement. This part is the key part of the drawing, so it seems that this is method is out of question to build a pie chart or any other pie drawings.
That's right, the issue there is that ClipPath hasn't been implemented yet on Windows, which is unfortunate. My suggestion there would be something that another commenter suggested which was to use DrawArc and/or FillArc, etc, instead of doing a circle and clipping out the part we don't want to view. That changes the code quite a bit, but it would at least work on Windows.
@@ProgrammingWithChris Thank you Chris. I was just looking at FillArc and it unfortunately fills the whole convex area under inside the arc, so not a good look for a pie chart when you go beyond 180 degrees. DrawArc with a thick stroke looks like a good compromise for now, it can implement a stylish pie chart :) Thanks again for the amazing videos and for the quick responses!
Thanks for watching! I recently started an email "Newsletter" that I'm going to send weekly, describing what types of things I'm studying and resources I found useful for programming and machine learning. If that sounds useful to you, here ya go! - programmingwithchris.substack.com/
🕘Timestamps:
00:00 - Video Start
00:32 - Demoing the Meter Drawables
02:01 - Showing How it Works in the XAML and Code Behind in .NET Maui
06:37 - The Linear Meter Drawable
12:59 - The Radial Gauge Drawable
Great job MAUI.
High performance!
Looks great! Can’t wait to tinker with this. Definitely subscribed. 😀
Thanks for sharing quality work like this. Much appreciated.
Very cool!
Great video thanks for sharing. Math is always the hardest part of development, I always struggle with that too. As for the 2 circles for the round dial you could have used canvas.DrawArc() - then you wouldn't need to clip that triangle area.
Oh wow, yeah, that’s a good point. Would certainly make some parts of it easier to deal with, that’s for sure.
Hi Chris, thanks for the great video. I am wondering if there's a way to change the GraphicsView Background color? I can't seem to get it to change.
Great video. What would it take to take this example a step further and make a standalone reusable component. Seems like this was not included but might be an idea for another video.
Yup! I've been thinking about the best way to do that lately, and am a little closer on some drawn controls I've made for my "ShoppingList" app. So I'll show that off in the next vid. And if I get enough of these together, i'd probably throw it in a class library or something, for reuse.
@@ProgrammingWithChris Is there an equivalent to WPF user controls in Maui? I think James M partially goes over some of this in: ua-cam.com/video/TkadU_OfmIE/v-deo.html . Your example uses graphics, so it’s different. I haven’t seen any Maui videos on making a graphical custom user control and then reusing that in another project. Just an idea. Thanks
Ah, yeah, that’s definitely one way you can do that, if you’re using existing controls. The path I’ve been going down is to create a class that inherits from, say, GraphicsView, and the you can creat custom properties and change the behavior any way you can, and then to use the new control you just use it’s name in the XAML. Fairly clean, so far, though I’ve run into a few tricky things with it. Will talk through it in the next vid.
great video thank you keep up the examples!
Great video! Is it possible to draw 2D charts with updating graphs?
Sure, yeah, you can do that, though I suspect there are some libraries out there that would be easier to use than drawing your own. But yeah, definitely!
Hi, pretty nice demo...
Have you tried to apply the IDrawable objects to an MVVM pattern - in the sense of changing values via properties?
I'm kinda struggling creating bindable properties AND invalidating the view with updated properties. I can invalidate things via the code behind; but then the whole MVVM approach is kinda... well...
Can't you use EventToCommand Behaviour?
I have the same problem, don't know how to make it work with MVVM
Hi Chris, could you do this for the line chart with single and multple lines, thank you.
Why didn't you use a Conic Gradient for the Meter? Why a linear Gradient?
Hi! Are you manged to solve your problem with blendmode? I can't(((
The reason you couldn't get blending to work is that it's only implemented on iOS/OSX, which is kind of ridiculous but that's what it is.
The example project does not work on Windows. It crashes with exception "After calling CanvasDrawingSession.CreateLayer, you must close the resulting CanvasActiveLayer before ending the CanvasDrawingSession." which is caused by the canvas.ClipPath(path); statement. This part is the key part of the drawing, so it seems that this is method is out of question to build a pie chart or any other pie drawings.
That's right, the issue there is that ClipPath hasn't been implemented yet on Windows, which is unfortunate. My suggestion there would be something that another commenter suggested which was to use DrawArc and/or FillArc, etc, instead of doing a circle and clipping out the part we don't want to view. That changes the code quite a bit, but it would at least work on Windows.
@@ProgrammingWithChris Thank you Chris. I was just looking at FillArc and it unfortunately fills the whole convex area under inside the arc, so not a good look for a pie chart when you go beyond 180 degrees. DrawArc with a thick stroke looks like a good compromise for now, it can implement a stylish pie chart :) Thanks again for the amazing videos and for the quick responses!
FYI blendmode is not supported except on iOS, and its pretty low priority for them so expect it to be a while before that works, so dont use it
I search Advanced MAUI, finding this!