View Full Version : Blend and C#
gigahertz205
January 17th, 2008, 10:47 PM
I dont know if this is possible, but is there a way to create GUIs for programs that i write in Visual C# Express 2008?
Say i write a program that does bank transactions. I know you can create GUIs using C# System.Forms and stuff, but i just want to know if you can create GUI in Blend and apply it to C# programs. It would be much quicker and look cooler if this is possible.
Thanks
kirupa
January 18th, 2008, 12:30 AM
Yep - it is definitely possible, but you need to make sure you are creating a WPF application. WinForms is a different (older) UI technology, and Blend only works with the UI (loose XAML files) created in WPF.
So, you can create a new WPF project in Visual C# 2008 and open (and edit) the same project in Blend, and everything will still work. The way I have my system setup, I have the same project open in both VS and Blend, and I use VS for editing the *.cs file and I use Blend for editing the *.xaml file ;)
alexgeek
January 18th, 2008, 04:23 PM
I get an error if I create a WPF project in VS C# 2008 and open with Blend :/
gigahertz205
January 18th, 2008, 05:07 PM
Yep - it is definitely possible, but you need to make sure you are creating a WPF application. WinForms is a different (older) UI technology, and Blend only works with the UI (loose XAML files) created in WPF.
So, you can create a new WPF project in Visual C# 2008 and open (and edit) the same project in Blend, and everything will still work. The way I have my system setup, I have the same project open in both VS and Blend, and I use VS for editing the *.cs file and I use Blend for editing the *.xaml file ;)
When i try to open the csproj file, it says "imported project "C:\Microsoft.CSharp.targets" was not found."
I tried to open the xaml separately, but different error occurs. Any ideas?
kirupa
January 19th, 2008, 12:51 AM
That's weird. If you do the exact opposite where you create a new project in Blend and then open that project in VS/VC#, does it work then?
gigahertz205
January 19th, 2008, 08:44 PM
Mm hmm. Creating project in blend and i can open the .cs file. Just to make sure, I edit the App.xaml.cs no the AssemblyInfo.cs to write my program right?
kirupa
January 19th, 2008, 10:10 PM
You edit the Window1.xaml.cs in VS :)
This tutorial should help you out: http://www.kirupa.com/net/creating_simple_wpf_gui_app_pg1.htm
alexgeek
January 20th, 2008, 10:18 AM
So you don't open the project just the .cs?
gigahertz205
January 20th, 2008, 09:14 PM
Yup, you just open the Windows1.xaml.cs file. I just finished that tutorial. It gives u a start.
kirupa
January 21st, 2008, 01:32 AM
You can always right click on a .CS file in Blend and select "Edit Externally", and that will launch Visual C# automatically.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.