Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I connect xaml and xaml.cs files

Tags:

c#

.net

wpf

xaml

I had a VB projected and converted it to C# using online conversion tools. Now the problem is xaml and xaml.cs file do not connect to each other, that is they don't recognize their dependencies (Red area in Fig). Actually it should appear like Window1 Files (Green Area in the image.) How can I achieve this.

Solution Explorer

I am trying my hands on WPF so may be a layman sort of question.

like image 400
Marshal Avatar asked Dec 15 '11 15:12

Marshal


People also ask

What are XAML CS files?

xaml. cs is the code-behind file where you write the business logic instead of inline code in . xaml. This provides more flexiblity of code separation and code readability.

What is XAML CS in C#?

xaml. cs is the code-behind page for MainPage. xaml. It's where you add your app logic and event handlers. Together these two files define a new class called MainPage , which inherits from Page, in the HelloWorld namespace.

How do I add XAML files to WPF project?

Just right click the project, choose Add -> Window and that will add a new xaml file along with its corresponding .

How do I use XAML files?

How to Open an XAML File. XAML files are used in . NET programming, so they can also be opened with Microsoft's Visual Studio. However, since they're text-based XML files, you can also open one and edit one with Windows Notepad or any other text editor.


1 Answers

This is simple, try to add in project existing items and select the XAML (not .cs, etc.) files in list of formats. In VS2010 thats helps.

like image 151
Papa John Avatar answered Oct 23 '22 09:10

Papa John