How to properly reference a class from XAML [closed]

人走茶凉 提交于 2019-11-30 21:18:32

OK... it suddenly started working. Just had to rebuild.

You can add a key so you can set the datacontext in the xaml instead behind code:

   <local:RangeValuesEditTemplateSelector x:key="RVETS">

Then for example set the outer grid's DataContext:

   <Grid DataContext={Binding Source = {StaticResource RVETS}} //Something like this I think

Then anything within that grid you can just bind directly to the property you set behind code. Not sure if this is useful or not, just thought I'd share :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!