Building a WPF Sudoku Game, Part 2: The Board UI and Validation

Sign in to queue

The Discussion

  • User profile image
    John Frandolig

    where can I download this project (thus far) ? - or do I wait until the end ?


  • User profile image

    Even with updates for the released build of WCF, this project fails and my project fail to build.  The statement :


    causes issues and adding the statement:

    <clr:SudokuBoard...> causes major issues with the DockPanel.  How is anyone supposed to learn from this article when a) in your laziness you did not specify where to put the xmlns:clr statement and what you provide as an example will not build???

  • User profile image

    thanks a lot at least u gave me an idea on what to do

  • User profile image

    Hey, I'm having trouble running through this tutorial in Visual C# 2008 Express. I can get about half way through it It looks like every time I use a StaticResource in a UserControl and then use that control in a window the window's designer bugs out. It displays a "Could not create instance of [UserControl]" error, even thought the project compiles and runs fine, and the UserControl looks fine in the designer.

    I found it when working through the tutorial and I assigned a LinearGradientBrush called ControlGradient to the App resources, used in in SodukuBoard.xaml, then tried to put the SodukuBoard on Window1 - the designer for Window 1 now throws a "Could not create instance of SodukuBoard" error.

  • User profile image
  • User profile image

    I've just found this article but I'd like to start from the beginning. Where is the link to part 1?

  • User profile image

    Your code seems to have been chopped off on the right some how leaving many of the entries incomplete.  Otherwise this is a very nice introduction to theese ideas in WPF

  • User profile image

    @LagDaemon:  True, I can go in and fix that.  You can also download the source at the top of the page.

  • User profile image

    Building this. However, when I click on the context menu, nothing comes up. I am not sure if I am missing something. I tried running your code in VS2008 it works fine. however mine does everthing expect the part where a number should appear in a cell, when you select the context menu.

    i did a comparison, and everything looks intact. I even copied your SudokuBoard.xaml and still did not work.

    I am stumped.

  • User profile image

    i ran into similar issues when i downloaded the code for part 1.  i couldn't even get the project file to load.  as far as i can tell, the staticreferrences have been removed since the winfx days, so you can just remove that keyword (and whatever else you have to to get it to compile).

    since i couldn't get the csproj to load, i created an empty project and dropped the xaml and c# code into that project (remember to add existing item so the solution knows about it).  you also must add referrences to windowsbase, windowscore, and presentationfoundationcore (vs will tell you which to add in the event that i forgot/misspelled those).

    finally, if you drop the code into a brand new project, vs will complain that you don't have a main method.  you must add this to the "secret" .g.cs file.  you can get to the file by viewing app.xaml.cs.  put your cursor on the name of the class (i.e. App), right click, and select "go to definition".  this should give you two choices, one of which is the .g.cs file. (there might be a better way to do all this, but this is all i could kludge together while watching tv Wink )

    to this file, add something like:

    /// <summary>

           /// Application Entry Point.

           /// </summary>



           public static void Main() {

               SudokuGame.App app = new SudokuGame.App();




    you may have to rebuild the solution to get it to work.  also, i only got it to work with my release executable (run without debug).

    if anyone has anything to add to this, please feel free!

    good luck!


  • User profile image

    The download link at the top is not working.. do we have a dump somewhere else???

  • User profile image

    @Nagaraj:  The Ch9 update broke this.  I fixed the link.

  • User profile image

    Where is the INotifyPropertyChanged interface defined?

  • User profile image

Add Your 2 Cents