|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace DemoApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Create Main Window instance
MainWindow window = new MainWindow();
// Create Main Window View Model
MainWindowViewModel viewModel = new MainWindowViewModel();
// Associate DataContext
window.DataContext = viewModel;
// Associate RequestClose Event Handler.
viewModel.RequestClose += (sender, args) => window.Close();
Application.Current.MainWindow = window;
window.Show();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software Engineer based out in Noida.
Technology skillset – .NET, WPF, WCF, LINQ, XAML.
Started blogging on http://1wpf.wordpress.com/
Stackoverflow Profile -> http://stackoverflow.com/users/649524/tilak