I am having the following code in my Xaml page of WPF project.
<Rectangle Name="myrect" MouseDown="myrect_MouseDown"/> I have tried to set the fill property of the rectangle in code behind (i.e. in Xaml.cs) but the name myrect is not accessible from code behind.. what is am missing here.?
I need to change the Fill property when particular rectangle is selected, any ways to achieve it through property binding or styles?
Thanks
x:Namesyntax (wherexis definedxmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"in the UserControl/Page.