Search
 Exclusive Interview Question

Can you explain how we can separate code and XAML?

Posted on 9/14/2009 | Category: WPF Interview questions | Views: 4123




This is one of the most important features of WPF, separating the XAML from the code to be handled. So designers can independently work on the presentation of the application and developers can actually write the code logic independent of how the presentation is.
 



Figure .1:- XAML and behind code in action



Above is the code snippet, which shows a XAML file and the code completely detached from the XAML presentation. In order to associate a class with XAML file you need to specify the x: Class attribute. Any event specified on the XAML object can be connected by defining a method with sender and event values. You can see from the above code snippet we have linked the MyClickEvent to an event in the behind code.

Asked In: Many Interviews Alert Moderator 

Share this to:

Bookmark It

Comments or Responses

Login to post response

Submit & Win
Submit and win
Prizes !
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Interviews Author
Thu, 18-Dec-2014 Authors
All Time Authors
Vishal@Neeraj
43920
Rajkatie
20680
Bharathi Cherukuri
18040

Latest members | More ...


(Statistics delayed by 5 minutes)