Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:41:12+00:00 2026-05-28T18:41:12+00:00

I generated this class using SQLMetal.exe. It is very bindable at runtime, but if

  • 0

I generated this class using SQLMetal.exe. It is very bindable at runtime, but if I use this class at design time, all of my design time blend bindings are busted.

I am using the MVVM-Light framework and I am building an app for WP7.

If I extract an interface for this class, and create a simple POCO that implements this interface and I use my simple poco in my design time data source, all of the bindings come alive.

Here is the class that was generated by SQLMetal.exe.

[Table(Name="InspectionGroup")]
public partial class InspectionGroup : INotifyPropertyChanging, INotifyPropertyChanged, IInspectionGroup
{

    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

    private int _InspectionGroupId;

    private string _GroupName;

    private System.DateTime _DateCreated;

    private EntitySet<InspectionHeader> _InspectionHeaders;

    private EntitySet<InspectionPoint> _InspectionPoints;

    #region Extensibility Method Definitions
    partial void OnLoaded();
    partial void OnValidate(System.Data.Linq.ChangeAction action);
    partial void OnCreated();
    partial void OnInspectionGroupIdChanging(int value);
    partial void OnInspectionGroupIdChanged();
    partial void OnGroupNameChanging(string value);
    partial void OnGroupNameChanged();
    partial void OnDateCreatedChanging(System.DateTime value);
    partial void OnDateCreatedChanged();
    #endregion

    public InspectionGroup()
    {
        this._InspectionHeaders = new EntitySet<InspectionHeader>(new Action<InspectionHeader>(this.attach_InspectionHeaders), new Action<InspectionHeader>(this.detach_InspectionHeaders));
        this._InspectionPoints = new EntitySet<InspectionPoint>(new Action<InspectionPoint>(this.attach_InspectionPoints), new Action<InspectionPoint>(this.detach_InspectionPoints));
        OnCreated();
    }

    [Column(Storage = "_InspectionGroupId", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
    public int InspectionGroupId
    {
        get
        {
            return this._InspectionGroupId;
        }
        set
        {
            if ((this._InspectionGroupId != value))
            {
                this.OnInspectionGroupIdChanging(value);
                this.SendPropertyChanging();
                this._InspectionGroupId = value;
                this.SendPropertyChanged("InspectionGroupId");
                this.OnInspectionGroupIdChanged();
            }
        }
    }

    [Column(Storage = "_GroupName", DbType = "NVarChar(100) NOT NULL", CanBeNull = false)]
    public string GroupName
    {
        get
        {
            return this._GroupName;
        }
        set
        {
            if ((this._GroupName != value))
            {
                this.OnGroupNameChanging(value);
                this.SendPropertyChanging();
                this._GroupName = value;
                this.SendPropertyChanged("GroupName");
                this.OnGroupNameChanged();
            }
        }
    }

    [Column(Storage = "_DateCreated", DbType = "DateTime NOT NULL")]
    public System.DateTime DateCreated
    {
        get
        {
            return this._DateCreated;
        }
        set
        {
            if ((this._DateCreated != value))
            {
                this.OnDateCreatedChanging(value);
                this.SendPropertyChanging();
                this._DateCreated = value;
                this.SendPropertyChanged("DateCreated");
                this.OnDateCreatedChanged();
            }
        }
    }

    [Association(Name = "FK_InspectionHeader_InspectionGroup", Storage = "_InspectionHeaders", ThisKey = "InspectionGroupId", OtherKey = "InspectionGroupId", DeleteRule = "CASCADE")]
    public EntitySet<InspectionHeader> InspectionHeaders
    {
        get
        {
            return this._InspectionHeaders;
        }
        set
        {
            this._InspectionHeaders.Assign(value);
        }
    }

    [Association(Name = "FK_InspectionPoint_InspectionGroup", Storage = "_InspectionPoints", ThisKey = "InspectionGroupId", OtherKey = "InspectionGroupId", DeleteRule = "CASCADE")]
    public EntitySet<InspectionPoint> InspectionPoints
    {
        get
        {
            return this._InspectionPoints;
        }
        set
        {
            this._InspectionPoints.Assign(value);
        }
    }

    public event PropertyChangingEventHandler PropertyChanging;

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void SendPropertyChanging()
    {
        if ((this.PropertyChanging != null))
        {
            this.PropertyChanging(this, emptyChangingEventArgs);
        }
    }

    protected virtual void SendPropertyChanged(String propertyName)
    {
        if ((this.PropertyChanged != null))
        {
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    private void attach_InspectionHeaders(InspectionHeader entity)
    {
        this.SendPropertyChanging();
        entity.InspectionGroup = this;
    }

    private void detach_InspectionHeaders(InspectionHeader entity)
    {
        this.SendPropertyChanging();
        entity.InspectionGroup = null;
    }

    private void attach_InspectionPoints(InspectionPoint entity)
    {
        this.SendPropertyChanging();
        entity.InspectionGroup = this;
    }

    private void detach_InspectionPoints(InspectionPoint entity)
    {
        this.SendPropertyChanging();
        entity.InspectionGroup = null;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:41:15+00:00Added an answer on May 28, 2026 at 6:41 pm

    Just had the same problem – I believe INotifyPropertyChanging stuff is not supported at desigtime, as this interface is designed to make life easier on the database. As there is no DB at designtime, the whole thing fail not letting you work in Blend (or in my case VS xaml visual editor)

    Commenting out PropertyChanging implementation fixes the problem. Of course some sort of pre-processor IFDEF would be better, but no idea on that part.. I just comment the code

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have my auto-generated linq to sql classes, and i extend this class using
I have this class: using System; using System.Collections.Generic; using System.Runtime.Serialization; namespace Grouping { [Serializable]
I just generated a class using the xsd.exe (See previous question ) and then
This issue is somewhat related: Problem with Code Generated by XSD.EXE: Sequence of Elements
This piece of valid json (it has been generated using php's json_encode): {html:form is
I am using SqlMetal to general my DataContext.dbml class for my ASP.net application using
I have a mapping class using JPA annotations, and I want it to use
How generate C# class using mgmtclassgen command for IISWebInfo ?? I test like this:
In my windows phone 7 app i have database-class generated by sqlmetal. in addition,
I have an insert query that gets generated like this INSERT INTO InvoiceDetail (LegacyId,InvoiceId,DetailTypeId,Fee,FeeTax,Investigatorid,SalespersonId,CreateDate,CreatedById,IsChargeBack,Expense,RepoAgentId,PayeeName,ExpensePaymentId,AdjustDetailId)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.