如何在xaml中绑定到当前riacontext用户
我有一个具有“getuserbyguid”方法的数据上下文,我想传入当前登录的user.userid作为参数,但我不知道如何通过xaml绑定到当前登录的用户。我尝试过 {Binding Path=User.UserId}
但没有任何运气。我正在使用内置的 riaservices 身份验证方法,因此用户信息应该在 riacontext 中公开,还是我错了?
例如,我有这个,
<riaControls:DomainDataSource x:Name="FollowingGridData" AutoLoad="True" QueryName="GetUsersFollowedByIDQuery" LoadSize="20">
<riaControls:DomainDataSource.DomainContext>
<my:NotesDomainContext />
</riaControls:DomainDataSource.DomainContext>
<riaControls:DomainDataSource.QueryParameters>
<riaControls:Parameter ParameterName="userguid" Value="{Binding Path=User.UserId}" />
</riaControls:DomainDataSource.QueryParameters>
</riaControls:DomainDataSource>
但它给了我一个错误,说它不是一个 guid,这意味着它不能正确绑定
I Have a datacontext that has a "getuserbyguid" method, i want to pass in the current logged in user.userid as a parameter, but I don't know how to bind to the current logged in user through xaml. I've tried {Binding Path=User.UserId}
but without any luck. I'm using the built in riaservices authentication methods, so the userinfo should be exposed in the riacontext, or am I wrong about this?
I have this for instance
<riaControls:DomainDataSource x:Name="FollowingGridData" AutoLoad="True" QueryName="GetUsersFollowedByIDQuery" LoadSize="20">
<riaControls:DomainDataSource.DomainContext>
<my:NotesDomainContext />
</riaControls:DomainDataSource.DomainContext>
<riaControls:DomainDataSource.QueryParameters>
<riaControls:Parameter ParameterName="userguid" Value="{Binding Path=User.UserId}" />
</riaControls:DomainDataSource.QueryParameters>
</riaControls:DomainDataSource>
But it gives me an error saying that it's not a guid, meaning that it must not be binding correctly
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的绑定是
The correct binding was