开发者

XamlParseException when using User Control

开发者 https://www.devze.com 2023-01-23 17:46 出处:网络
I\'m facing the following problem: I have created a user control in XAML that has an x:Name associated because I have some bindings internally that need this name. On the main page I use multiple inst

I'm facing the following problem:

I have created a user control in XAML that has an x:Name associated because I have some bindings internally that need this name. On the main page I use multiple instances of this user co开发者_C百科ntrol and all of the sudden a XamlParseException is thrown which tells me that the name is already in use; but this does not happen always.

Does anybody have the same issue? Has anybody an idea on how to resolve this?


Op's update from a comment, below (which may be deleted):

As I found out, this is a known bug of Silverlight.

My workaround was to avoid the name attribute on user controls that I use multiple times by setting the control itself as DataContext and then I used bindings to get things working.

0

精彩评论

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