Is it possible to name something in XAML without getting a field for that object?
Posted
by Mikael Sundberg
on Stack Overflow
See other posts from Stack Overflow
or by Mikael Sundberg
Published on 2010-06-09T13:35:43Z
Indexed on
2010/06/09
13:42 UTC
Read the original article
Hit count: 155
I use x:Name
to name an element in XAML because I want to be able to reference it using Storyboard.TargetName
but everything that has x:Name
set also gets a field generated in the code-behind. Is it possible to target an element with Storyboard.TargetName
without getting a field (which FxCop gives a warning about unused private code for).
Thanks.
© Stack Overflow or respective owner