Mayhana
Mayhana

Reputation: 5

How to connect WPF Application project to Windows Game project?

I need to connect a WPF project with a Windows Game project.

I have one project done in Windows Game and another project done in WPF.

I need to open the Game1 from DemoScene project by clicking a button in WPF.

And this is method in WPF project on button click...

private void Playgame_Click(object sender, RoutedEventArgs e) {

        System.Diagnostics.Process.Start(i don't know how to put on this);
    }

How can I do this? (I'm a beginner)

Upvotes: 0

Views: 490

Answers (2)

Maple Wan
Maple Wan

Reputation: 61

Put your two projects in the same folder, for example, in your WPF application folder, there exists a path "game\Game1.exe". Then you can try the code below in your WPF application button click event.

System.Diagnostics.Process.Start(AppDomain.CurrentDomain.StartupPath + "game\\Game1.exe");

Upvotes: 0

TGH
TGH

Reputation: 39258

System.Diagnostics.Process.Start(@"c:\game\Game1.exe");

Try the above with your path.

More here: http://msdn.microsoft.com/en-us/library/53ezey2s.aspx

Upvotes: 0

Related Questions