views:

19

answers:

0

I feel like I'm missing something very obvious here but I can't get basic binding to work with objects from my EDM.

Here's my xaml:

    <TextBox Text="{Binding Path=receipt.STATUS}"  Height="23" HorizontalAlignment="Left" Margin="371,276,0,0" VerticalAlignment="Top" Width="120" />

Here's my View code-behind:

public MainWindow()
{
    InitializeComponent();
    _vw = new SimpleViewModel();
    DataContext = _vw;
}

Here's my ViewModel:

class SimpleViewModel
{
    private MyEntities _context;
    public RECEIPT receipt;
    ...
    public void GetReceipt(receiptKey)
    {
        IQueryable<RECEIPT> r = from it in _context.RECEIPTs
                                      where it.RECEIPTKEY == receiptKey
                                      select it;
        receipt = r.First();
    }
}