Search code examples
c#xamlmvvmwindows-phone

Creating custom graphics with Windows Phone XAML


I am creating a WP 8.1 app with MVVM Light Toolkit. I have to call a service of weather measurings information, and then, I have to create different graphics with the indicator showing the value of the service response. For example, I have this image:

Empty Graphic

And it should be like this:

Complete graphic

Or these images:

enter image description here

enter image description here

And should end up like this:

enter image description here

How can I get the position where I would put the shape indicating the value? Or in the second case, the needle pointing the value? And, how would I support multiple resolutions?


Solution

  • you should draw everything in a Canvas panel. There you can control the assets positions and transformations. This also requires to have objects to preserve the state of each thing. This question maybe doesn't have an easy answer but I strongly recommend to you learn about that in this links