system.componentmodel

Data Binding POCO Properties

Are there any data binding frameworks (BCL or otherwise) that allow binding between any two CLR properties that implement INotifyPropertyChanged and INotifyCollectionChanged? It seems to be it should be possible to do something like this: var binding = new Binding(); binding.Source = someSourceObject; binding.SourcePath = "Customer.Name...

Difference between ISupportInitialize (BeginInit/EndInit) and SuspendLayout/ResumeLayout

Hello All! Could someone please explain what the difference is between using the ISupportInitialize interface methods (BeginInit/EndInit) and using SuspendLayout/ResumeLayout? Is ISupportInitialize ONLY used during construction/"initial" initialization... or can it be used later when you want to add new child controls to an existing pa...

Windows control returns different values when accessed different ways

I have a control, hosted on DesignSurface. When its Location property is accessed by control.Location, and when it's accessed by propertyDescriptor.GetValue(control), I get different values. propertyDescriptor is of type PropertyDescriptor. Does anyone have a solution to this? I have checked that the object instance is the same. ...

TypeDescriptor.CreateProperty doesn't add a property

I am trying to add a property to a type using TypeDescriptor.CreateProperty in order to display an additional property in a property grid, however this new property is not added and when I call TypeDescriptor.GetProperties on that type to inspect the properties, this property does not exist. It there something I might be missing or over...

C#: System.ComponentModel.Design does not contain ArrayEditor...

I'm working on making a complex object designer compliant and was going to utilize the ArrayEditor component... Needless to say, I don't have it... MSDN says it comes from .NET 1.1 which I most certainly do have and then some. Any ideas? ...

Custom Component property won't serialize after intial change

Can/Should a derived Component class have a property of type another derived Component type? I have a RecordComponent that derives from System.ComponentModel.Component. It has three properties DeleteCmd, SaveCmd, and BoundCmd. Those properties are of type DeleteCommand, SaveCommand, and BoundCommand respectively. DeleteCommand and Sa...

ComponentModel, PropertyGrids and Intefaces in C#

Hi, I have a bunch of objects that implement different interfaces, some properties of this interfaces should be showed and edited through a PropertyGrid, but if I specify something like DisplayName, Browsable or DescriptionAttribute, they will not be "inherited" by the class that implements the interface... why is this? and is there any ...

System.ComponentModel namespace usage

I consider myself a reasonably experienced .NET developer but I have almost never directly used types in the System.ComponentModel namespace. (I've implemented a few custom attributes and consumed them via reflection). In what sort of scenarios do types such as Component, Container, PropertyDescriptor, TypeDescriptor, License and TypeCo...

Error using System.ComponentModel.SortDescription from IronPython

I need to use SortDescription from IronPython. But whenever I attempt to access SortDescription from IPy, I get the following error message: AttributeError: attribute 'SortDescription' of 'namespace#' object is read-only. I'm using IronPython 2.6 (2.6.10920.0) Is there some special IPy syntax that I have to use? ...

.NET Component Model explanation

First of all, I have to say that I'm going to talk about System.ComponentModel.Component. You know, I understand, that the .NET Component Model provides ability (through Site Services) to define separate Components, so they can communicate with each other in a loosely coupled way, and that each Component is easily replaceable. But my ...

How does the Control class, provide the ForeColor, BackColor and Font default values?

I know that component-model indicates whether a property has a default value or not, by means of ShouldSerializeValue method of PropertyDescriptor. The base windows-forms Control class, has some properties like ForeColor, BackColor and Font, that defaults to the same value of the parent, but I could not find any TypeDescriptor or Proper...

MEF and unit testing with NUnit

A few weeks ago I jumped on the MEF (ComponentModel) bandwagon, and am now using it for a lot of my plugins and also shared libraries. Overall, it's been great aside from the frequent mistakes on my part, which result in frustrating debugging sessions. Anyhow, my app has been running great, but my MEF-related code changes have caused m...

What is the difference between IEditableObject and IRevertibleChangeTracking?

What is the difference between IEditableObject and IRevertibleChangeTracking (both from the System.ComponentModel namespace)? It looks as if the first supports explicit transaction whilst the second is more implicit - but the net result is the same. How should I go about implementing this in code? At the moment I do nothing in BeginEd...

Recreating "Font" Property Behavior

Controls that inherit off of System.Web.UI.WebControls.WebControl have a property called Font. The type is System.Web.Ui.WebControls.FontInfo. When working with these controls in the designer, it breaks out the Font property into multiple properties like Font-Bold, Font-Italic, etc. When working with these same WebControls in the codeb...

Which attribute to use in System.ComponentModel namespace for setting order of fields?

By default, the fields in the designer are listed in alphabetical order. Does anyone know which attribute to use in the System.ComponentModel namespace to set the order explicitly? ...

Updating WPF GUI from a DLL

This seems like it would be pretty common task, but I'm not having any luck searching for an answer. I have a WPF/C# application that relies heavily on a dll for database routines. I would like the dll to update some GUI elements, i.e. a progress bar. So far, it seems that the answer lies somewhere in System.ComponentModel and creating...

Could not find Assembly System.ComponentModel

Hi All, I'm using Silverlight 4. I need to do grouping in my DataGrid. So i need to add add reference to System.ComponentModel. I could not find System.ComponentModel in "Add Reference". I added reference to System.ComponentModel.DataAnnotations and the added the following XMLNS in my XAML Page xmlns:cm="clr-namespace:System.Windows.Da...

Using System.ComponentModel.DisplayName with dynamic values?

Im trying to implement multi-language support in my system, the other systems at work uses xmlfiles for this generated from a database that they have used for some time now so they want me to use this aswell. I have managed to translate everything except the displaynames in my formmodels, these values can apperantly only be constant va...

Overridding ComponentModel attributes (ie, DisplayName) doesn't work as expected

I have two classes: public class DocumentViewModel { public virtual string DocumentNumber { get; set; } } public class PurchaseOrderViewModel : DocumentViewModel { [DisplayName("PO Number")] public override string DocumentNumber { get; set; } } And a view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserContro...

What is "System.ComponentModel.Design.DateTimeEditor+DateTimeUI" ?

Greetings, doing research into outside code I got this control returning { Name = "DateTimeUI" FullName = "System.ComponentModel.Design.DateTimeEditor+DateTimeUI" } to Type.GetType(). I've no idea what DateTimeUI is, and "DateTimeEditor+DateTimeUI" seems pretty confusing aswell. The class isnt defined in the code I was resear...