- vmwrapperexpress.zip
- VmWrapperExpress
- AppIcon
- VmWrapperExpress.ico
- Documentation
- Pending Issues.docx
- SetupVmWrapperExpress
- Debug
- Release
- setup.exe
- SetupVmWrapperExpress.msi
- SetupVmWrapperExpress.vdproj
- VmWrapperExpress.sln
- VmWrapperExpress
- App.xaml
- App.xaml.cs
- bin
- Debug
- Release
- Templates
- CollectionWrapper.cs.template
- ObjectWrapper.cs.template
- ViewModelBase.cs.template
- VmCollectionBase.cs.template
- VmObjectBase.cs.template
- VmWrapperExpress.exe
- VmWrapperExpress.pdb
- VmWrapperExpress.vshost.exe
- VmWrapperExpress.vshost.exe.manifest
- DomainModel
- obj
- Debug
- Release
- Properties
- Services
- Templates
- CollectionWrapper.cs.template
- ObjectWrapper.cs.template
- ReadMe.txt
- ViewModelBase.cs.template
- VmCollectionBase.cs.template
- VmObjectBase.cs.template
- Utility
- View
- ViewModel
- VmWrapperExpress.csproj
- VmWrapperExpress.csproj.user
- VmWrapperExpress.ico
- vmwrapperdemo.zip
- VmWrapperDemo
- _ReSharper.VmWrapperDemo
- CachesImage.bin
- ProjectModel
- ProjectModel.dat
- TodoCache
- WebsiteFileReferences
- .version
- WordIndex.New
- Xaml
- CacheProvider.dat
- VmWrapperDemo.4.5.resharper.user
- VmWrapperDemo.Domain
- VmWrapperDemo.sln
- VmWrapperDemo.ViewModel
- VmWrapperDemo
|
using System;
using System.Collections.Generic;
using System.Windows;
using VmWrapperDemo.Domain;
using VmWrapperDemo.View;
using VmWrapperDemo.ViewModel;
namespace VmWrapperDemo
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
/* We don't want to clutter up the demo with NHibernate code, so we
* manually create the same type of collections that NHibernate would
* return to us if we were reading from a database. */
// Create domain model
IList<Customer> customers = new List<Customer>();
var newCustomer = new Customer("Doe Shipping, Inc.", "John Doe");
newCustomer.Orders.Add(new Order(new DateTime(2009, 04, 01), 1000));
newCustomer.Orders.Add(new Order(new DateTime(2009, 04, 15), 750));
customers.Add(newCustomer);
newCustomer = new Customer("Roe Salvage, Inc.", "Larry Roe");
newCustomer.Orders.Add(new Order(new DateTime(2009, 04, 08), 2000));
newCustomer.Orders.Add(new Order(new DateTime(2009, 04, 22), 1500));
customers.Add(newCustomer);
// Create view model
var mainWindowViewModel = new MainWindowViewModel(customers);
// Initialize main window
var mainWindow = new WindowMain();
mainWindow.DataContext = mainWindowViewModel;
mainWindow.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.
David Veeneman is a financial planner and software developer. He is the author of "The Fortune in Your Future" (McGraw-Hill 1998). His company, Foresight Systems, develops planning and financial software.