Public Sub New(ByVal log As Entities.LogSystem)
    Me.DataContext = log
End Sub

This is the the initializer for my custom control It passes in a single entity that has several property fields. This control is added to a parent control so that it appears in a stackpanel.

Anyway I am trying to get the specific data from this control into several different text boxes:

<UserControl x:Class="LogSystemPickerItem"
    Width="579" Height="122">
        <local:LogSystemPickerItem x:Key="Log"/>

    <Grid DataContext="{Binding Source={StaticResource Log}}">
        <Label Height="30" Name="Label1" VerticalAlignment="Top" Content="{Binding deptDescription}"/>


As you can see i havent really gotten too far. I have tried many different ways to do this including using dependency properties...I just really cant find a tutorial that shows this specific circumstance...can anyone point me in the right direction?


If you're setting the DataContext in the code behind as per your first code snippet, there's no need to also do it in the XAML, so you can remove the "Log" resource and the corresponding DataContext assignment on the Grid.

Once you've done that, it should work assuming there is a deptDescription property on your log class.

HTH, Kent

Kent Boogaart
sweet that worked. BUT...I really would rather have it in the XAML so that I can have designtime access to the control. I had it working with a datagrid, but I couldnt figure out how to do it in the textbox. Also I had a casing issue with the deptDescription should have been DeptDescription. So I have the xaml correct too? its just a matter of either/or?

... and in XAML you may do it this way...

doing it this way causes my IDE to crash.