Home > DeveloperSection > Forums > Access to the path xaml
jayprakash sharma
jayprakash sharma

Total Post:117

Posted on    December-23-2013 2:29 AM


 1 Reply(s)
 1237  View(s)
Rate this:

I have problem with access to the path in canvas, I want to be able to changing the 'fill' in my code(c#). 

These is my xaml code:

<Canvas Name="hour" Opacity="0.05" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="0" Height="0" >

    <Path Fill="Aquamarine">


            <EllipseGeometry RadiusX="50" RadiusY="50"/>




Anyone has an idea, how to get it? Thanks for help!

Pravesh Singh

Total Post:412

Posted on    December-23-2013 5:01 AM

Hi Jay,

Just give it a name:

<Path x:Name="myPath" Fill="Aquamarine">

So you can access it in code, like:

myPath.Fill = new SolidColorBrush(Colors.Blue);

Don't want to miss updates? Please click the below button!

Follow MindStick