The App Class
The App class is generated by Visual Studio if you use it (I do). The code is split across two files: One of them is called App.g.cs and you can find it in the Debug/obj folder, but don't modify it. The other file is called App.xaml.cs and you can find it in the project folder. In this file you can add application-level event handlers like OnStartup() and OnExit(). In this case it is pretty trivial:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace MP3DurationCalculator
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
The two files are merged to a single class by the virtue of the partial class feature of C#. In addition to the code files there is also the application XAML file called App.xaml. This file contains a couple of namespaces, identifies the application class (MP3DurationCalculator.App and the URI of the main windows's XAML file. WPF takes it from here and knows how to instantiate the App and display the main window.
<Application x:Class="MP3DurationCalculator.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>


