---
title: "What is app.xaml?"  
description: "What is app.xaml?"  
author: "AVADHESH PATEL"  
published: 2012-11-17  
updated: 2020-09-24  
canonical: https://www.mindstick.com/interview/1573/what-is-app-xaml  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# What is app.xaml?

App.xaml is a file used by Silverlight **applications** to **declare** shared resources like brushes, various style objects, **templates** etc. Also, **the code**-behind file of app.xaml.cs is used to handle global **application** level events like Application_Startup, Application_Exit, and Application_UnhandledException (similar to the Global.asax file for ASP.NET applications).\
\
When Visual Studio creates the app.xaml file automatically, it creates a few event handlers with some default code. You can change the code appropriately.\
Collapse\
\
private void Application_Startup(object sender, StartupEventArgs e)\
{\
}\
\
private void Application_Exit(object sender, EventArgs e)\
{\
}\
\
private void Application_UnhandledException(object sender, \
ApplicationUnhandledExceptionEventArgs e)\
{\
}\
\
For ASP.NET developers, the above code will look familiar. This is similar to **the application** level event handlers in Global.asax.

## Answers

### Answer by AVADHESH PATEL

App.xaml is a file used by Silverlight **applications** to **declare** shared resources like brushes, various style objects, **templates** etc. Also, **the code**-behind file of app.xaml.cs is used to handle global **application** level events like Application_Startup, Application_Exit, and Application_UnhandledException (similar to the Global.asax file for ASP.NET applications).\
\
When Visual Studio creates the app.xaml file automatically, it creates a few event handlers with some default code. You can change the code appropriately.\
Collapse\
\
private void Application_Startup(object sender, StartupEventArgs e)\
{\
}\
\
private void Application_Exit(object sender, EventArgs e)\
{\
}\
\
private void Application_UnhandledException(object sender, \
ApplicationUnhandledExceptionEventArgs e)\
{\
}\
\
For ASP.NET developers, the above code will look familiar. This is similar to **the application** level event handlers in Global.asax.


---

Original Source: https://www.mindstick.com/interview/1573/what-is-app-xaml

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
