Hi
I am getting these errors while running Code Analysis on my Silverlight Application in VS 2008 SP1
Error 7 CA1823 : Microsoft.Performance : It appears that field 'Page.LayoutRoot' is never used or is only ever assigned to. Use this field or remove it. C:\Silverlight.Controls\obj\Debug\Page.g.cs 38 Silverlight.Controls
Error 8 CA1823 : Microsoft.Performance : It appears that field 'ProductTree.addProduct' is never used or is only ever assigned to. Use this field or remove it. C:\Silverlight.Controls\obj\Debug\MyTree.g.cs 58 Silverlight.Controls
Here LayoutRoot is the root Grid and addProduct is a Button, XAML for same is
<Button Name="addProduct"
Content="Add Product(s)" Width="100"
Click="addProduct_Click"></Button>
click event "addProduct_Click" is defined in code behind page.
If I remove the "Name=addProduct" attribute of addProduct button the Code Analysis error message disappears. I don't think it should be proper to remove Name Attribute from all buttons.
Please tell me how can I supress these Code Analysis errors.
-- Irfan