Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Building WPF Applications with Self-Tracking Entity Generator - Project Setup

, 20 Feb 2012
This article describes the project setup of building a WPF sample application with Self-Tracking Entity Generator for WPF/Silverlight.
SchoolSample_20111201.zip
SchoolSample
Local.testsettings
SchoolSample.vsmdi
TraceAndTestImpact.testsettings
Assemblies
GalaSoft.MvvmLight.Extras.WPF4.dll
GalaSoft.MvvmLight.WPF4.dll
Moq.dll
System.Windows.Interactivity.dll
WPFToolkit.Extended.dll
ComponentModel.Composition.Initialization.Desktop
Microsoft
ComponentModel
Composition
Hosting
Internal
Properties
System
ComponentModel
Composition
Hosting
System.Windows.Controls.Data.Input
Common
Properties
Settings.settings
themes
Validation
Database
SchoolSample
SchoolSample.csproj.user
Asset
Control
Properties
Settings.settings
View
SchoolSample.Common
Model
Properties
Resource
SchoolSample.Data
EntityModel
Properties
Validation
SchoolSample.Data.Wcf
EntityModel
SchoolModel.edmx
Properties
Validation
SchoolSample.Model
Properties
SchoolSample.ViewModel
Properties
SchoolSample.Wcf
SchoolSample.Wcf.csproj.user
Properties
Service
SchoolService.svc
SchoolSample.WCFService
SchoolSample.WCFService.csproj.user
Properties
Service References
SchoolService
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
SchoolService.disco
SchoolService.wsdl
Test.SchoolSample.Model
Properties
Test References
SchoolSample.Model.accessor
Test.SchoolSample.ViewModel
Properties
Test References
SchoolSample.ViewModel.accessor
SchoolSample_20120117.zip
Local.testsettings
SchoolSample.vsmdi
TraceAndTestImpact.testsettings
GalaSoft.MvvmLight.Extras.WPF4.dll
GalaSoft.MvvmLight.WPF4.dll
Moq.dll
System.Windows.Interactivity.dll
WPFToolkit.Extended.dll
Settings.settings
SchoolSample.csproj.user
Settings.settings
SchoolModel.edmx
SchoolSample.Wcf.csproj.user
SchoolService.svc
SchoolSample.WCFService.csproj.user
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
SchoolService.disco
SchoolService.wsdl
SchoolSample.Model.accessor
SchoolSample.ViewModel.accessor
SchoolSample_20120216.zip
Local.testsettings
SchoolSample.vsmdi
TraceAndTestImpact.testsettings
GalaSoft.MvvmLight.Extras.WPF4.dll
GalaSoft.MvvmLight.WPF4.dll
Moq.dll
System.Windows.Interactivity.dll
WPFToolkit.Extended.dll
Settings.settings
SchoolSample.csproj.user
Settings.settings
SchoolModel.edmx
SchoolSample.Wcf.csproj.user
SchoolService.svc
SchoolSample.WCFService.csproj.user
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
SchoolService.disco
SchoolService.wsdl
SchoolSample.Model.accessor
SchoolSample.ViewModel.accessor
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;

#if (SILVERLIGHT || WPF)
namespace SchoolSample.EntityModel
{
    public class ValidationResultChangedEventArgs : EventArgs
    {
        public ValidationResultChangedEventArgs(string propertyName, IList<ValidationResult> removedItems, IList<ValidationResult> addedItems)
        {
            PropertyName = propertyName;
            RemovedItems = removedItems ?? new List<ValidationResult>();
            AddedItems = addedItems ?? new List<ValidationResult>();
        }
    
        public string PropertyName { get; private set; }
        public IList<ValidationResult> AddedItems { get; private set; }
        public IList<ValidationResult> RemovedItems { get; private set; }
    }
    
    // An interface that provides an event that fires when validation results changed
    public interface INotifyValidationResultChanged
    {
        event EventHandler<ValidationResultChangedEventArgs> ValidationResultChanged;
    }
    
    // An interface that defines the only method GetNextLevelNodes()
    // which computes the level ofa node inside the object graph
    public interface INodeLevel
    {
        List<INodeLevel> GetNextLevelNodes(Dictionary<INodeLevel, int> nodeLevelDictionary);
    }
    
    // An interface that provides methods and properties for client side change tracking
    public interface IClientChangeTracking
    {
        // accepts changes made to the entity object
        void AcceptChanges();
        // rejects changes made to the entity object
        void RejectChanges();
        // whether the entity object has any changes
        bool HasChanges { get; }
        // accepts changes made to the entity object and all objects of its object graph
        void AcceptObjectGraphChanges();
        // rejects changes made to the entity object and all objects of its object graph
        void RejectObjectGraphChanges();
        // returns whether the entity object along with its object graph has any changes
        bool ObjectGraphHasChanges();
        // returns the estimate size of the entity object along with its object graph
        long EstimateObjectGraphSize();
        // returns the estimate size of the optimized entity object graph with only objects that have changes
        long EstimateObjectGraphChangeSize();
        // returns an optimized entity object graph with only objects that have changes
        IObjectWithChangeTracker GetObjectGraphChanges();
    }
}
#endif

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Weidong Shen
Software Developer (Senior)
United States United States
Weidong has been an information system professional since 1990. He has a Master's degree in Computer Science, and is currently a MCSD .NET

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 20 Feb 2012
Article Copyright 2011 by Weidong Shen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid