I defined a domain context as a user resource
<UserControl.Resources>
<my:ParkDomainContext x:Key="parkDomainContext" />
</UserControl.Resources>
I have bounded to table query result to this domain context in my code behind
_parkDomainContext = this.Resources["parkDomainContext"] as ParkDomainContext;
_parkDomainContext.Load(_parkDomainContext.GetLocationsQuery(), LoadLocationComplete, null);
_parkDomainContext.Load(_parkDomainContext.GetParksQuery(), LoadParkComplete, null);
After this I have bounded the static domain context to a combo box as following
<ComboBox x:Name="cboLocation" Grid.Column="1" Grid.Row="1"
ItemsSource="{Binding Path=Locations, Source={StaticResource parkDomainContext}}"
SelectedItem="{Binding Path=Locations, Mode=TwoWay}"
DisplayMemberPath="ParkLocation"
/>
It's working fine but when I bind the same domain context to a textbox as follows:
<TextBox Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="locationIDTextBox"
VerticalAlignment="Center" Width="120"
Text="{Binding Source={StaticResource parkDomainContext}, Path=Locations.ParkLocation}" >
It doesn't show me any result .
I know that my domain context has query result and there must be something wrong in binding it to Textbox.
PLease let me know the solution..