Llmar,
You will need to move your code that references controls below the method call to InitializeComponent. The controls are referenced before they are created.
Tim
>I've simplified the project, basically its only the mmBusinessWindow with an instance of the DataGrid on it. I've set the columns and their data sources in Expression Blend (essentially following the Dev Guide's "Data Binding WPF Controls" section. The codebehind code is now simply this:
>
>
> public partial class MyJokesWindow : mmBusinessWindow
> {
> private Humor Humor;
>
> /// <summary>
> /// Constructor
> /// </summary>
> public MyJokesWindow()
> {
> this.Humor = (Humor)this.RegisterBizObj(new Humor());
> //this.Window.DataContext = this.Humor.GetMyJokesByPunchline("test");
> // the above gives: "Object reference not set to an instance of an object."
> //this.Window.DataContext = this.Humor.GetAllEntities();
> //this.grdMyJokes.ItemsSource = this.Humor.GetMyJokesByPunchline("test");
> //and above gives the same error
> // this.grdMyJokes.ItemsSource = this.Humor.GetAllEntities();
> //and above gives the same error
> this.InitializeComponent();
> }
> }
>
>
>But all the commented out variations of trying to retrieve the entity list above result in the same error:
>"Object reference not set to an instance of an object."
>
>The method being called returns a set of entity objects, and works fine in the business object.
Timothy Bryan