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