Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
<viewbox width="48" height="48" margin="0 20 0 0">
   <Canvas Width="24" Height="24">
   <path x:name="myPath" data="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 Fill=" green=" /><br mode=" hold=" />  </Canvas><br mode=" xmlns:x="#unknown"></path></viewbox>
Posted
Updated 20-Jun-16 3:24am
v2
Comments
CHill60 20-Jun-16 7:01am    
What are you tried to colour and what have you tried?
Sergey Alexandrovich Kryukov 20-Jun-16 9:19am    
It won't build. Path is spelled "Path", not "path", if you are asking about .NET FCL System.Windows.Shapes.Path, of course.
—SA

1 solution

I can give you one general advice: to see how something you write in XAML works during runtime, simply look at the auto-generated code. Create some project with windows, pages and/or user controls using XAML and build it, make sure it works. All such XAML code is then used to auto-generate some code, in your case, C# code, which is further compiled.

When your project is built, by default, you can find that auto-generated code under the sub-directory "obj" which is created under the sub-directory of your project. Learn it. It is useful in all cases. If later you have some other problems like that, you can do it again.

Another way is just reading MSDN documentation knowing only some basic principles. This is how you create a Path object and setup its properties:
Path Class (System.Windows.Shapes),
including Fill: Shape.Fill Property (System.Windows.Shapes).

This is how you add it to an instance of Canvas:
Panel.Children Property (System.Windows.Controls),
UIElementCollection Class (System.Windows.Controls),
UIElementCollection.Add Method (UIElement) (System.Windows.Controls).

And so on…

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900