Print Page | Close Window

cocktail the name 'InitializeComponent' does not exist in the current context

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3889
Printed Date: 04-May-2024 at 11:55am


Topic: cocktail the name 'InitializeComponent' does not exist in the current context
Posted By: decoda
Subject: cocktail the name 'InitializeComponent' does not exist in the current context
Date Posted: 14-Jan-2013 at 4:22am
Hi

I Started a 4.5 wpf solution and used nuget to add cocktail to test out happyhour part2 tutorial, my problem is the app compiles and runs but no window shows up.

 i added to the App.xaml.cs

public App()
{
            InitializeComponent();
 }

and got this error (the name 'InitializeComponent' does not exist in the current context)

all the namespaces are the same, tried several things but am stuck the appbootsrap is not getting called.

thank you



Replies:
Posted By: mgood
Date Posted: 14-Jan-2013 at 8:33am
I'm a bit confused. HappyHour is a Silverlight tutorial not WPF. However, App.xaml.cs should look like this.
    public partial class App
    {
        public App()
        {
            InitializeComponent();
        }
    }
 
Also, for WPF, the bootstrapper needs to be defined inside a ResourceDictionary as documented here:
 
http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-application-bootstrapper#HCreatingabootstrapper - http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-application-bootstrapper#HCreatingabootstrapper



Print Page | Close Window