public static void Main(string[] args) { Application.Init (); MainWindow win = new MainWindow (); win.Show (); Application.Run (); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Main = ((BookReader.MainWindow)(target)); return; } this._contentLoaded = true; }
private void Application_Startup(object sender, StartupEventArgs e) { MainWindow window = new MainWindow(); // Create the ViewModel var viewModel = new MainWindowViewModel(); window.DataContext = viewModel; // Save the options when window is closed window.Closed += ((src,ea) => viewModel.Close()); window.Show(); }