开发者

No applicable name scope exists WPF error

开发者 https://www.devze.com 2023-02-13 00:58 出处:网络
I created simple rectangle ->make into control and then added it to new resourcedictionary . I am gettingerror when i am trying to animate it.\"No applicable name scope exists to resolve the name \'re

I created simple rectangle ->make into control and then added it to new resourcedictionary . I am getting error when i am trying to animate it. "No applicable name scope exists to resolve the name 'rectangle' error" .

How can I fixed this from xaml ?(i know that is sometihing wrong with namescopes but i want to fix it in xaml) tanks for hel开发者_运维技巧p


You cannot fix it in XAML if the control was created in code. You register the control in a NameScope.

MSDN

If the name is not registered, the added object cannot be referenced by name through methods such as FindName, and you cannot use that name for animation targeting.

See also the Storyboards Overview there is an example of how to deal with dynamically added controls.

0

精彩评论

暂无评论...
验证码 换一张
取 消