Are you using MVVM . if so then in the view model create the property with name UserId
public int32 UserId{ get{...} set {...}}
then in viewmodel call methods like wcf/webservice or sql call and get the data and assign it to the property UserId you created.
Then in the XAML page :
<textbox text="{Binding UserId}" />
And I think you will get what you want.