小编Mic*_*lle的帖子

使我的Usercontrol的属性可绑定

我创建了一个自定义用户控件,我在我的主xaml控件上使用:

<Controls:CustomControl  Width="200" Height="20" 
TotalCount="{Binding TotalRecordCount}" SuccessCount="{Binding ValidationCount}" ErrorCount="{Binding ValidationErrorCount}" Margin="0,5,0,0"  HorizontalAlignment="Left"> 
</Controls:CustomControl>
Run Code Online (Sandbox Code Playgroud)

我想让我的自定义usercontrol的私有变量是ErrorCount,SuccessCount和总计数(类型为int32)Bindable所以我可以绑定值给它们.现在,当我尝试将它绑定到我的项目源时,它会给出以下错误e异常消息是"类型为'System.Windows.Data.Binding'的对象'无法转换为'System.Int32'类型'

非常感谢,米歇尔

silverlight

5
推荐指数
1
解决办法
1788
查看次数

标签 统计

silverlight ×1