开发者

Silverlight 3 - FindName returns null

开发者 https://www.devze.com 2022-12-11 21:21 出处:网络
This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null.

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null.

<Grid>
  <common:CommonGridEditPanel x:Name="scannerParameters" Grid.Row="0" DataContext="{Binding Parameters}">
  <common:CommonGridEditPanel.Columns>
</Grid>

scannerParameter variable is assigned with null value, on further digging i noticed the below code in auto-generated section of the file.

this.scannerParameters = ((CommonGridEditPanel)(this.FindName("scannerParameters")));

Is t开发者_开发技巧his a known bug ?


There is no "Known bug" in this area. Like itowlson asks, it would help you showed us what you are actually doing. Most likely what you are actually doing is where the bug is.

0

精彩评论

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

关注公众号