How to bind to current riacontext user in xaml

Posted by Jakob on Stack Overflow See other posts from Stack Overflow or by Jakob
Published on 2010-05-27T10:12:27Z Indexed on 2010/05/27 13:21 UTC
Read the original article Hit count: 212

Filed under:
|
|
|

Hi. 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

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf