Questions tagged [system.componentmodel]

The System.ComponentModel namespace provides classes that are used to implement the run-time and design-time behavior of components and controls. This namespace includes the base classes and interfaces for implementing attributes and type converters, binding to data sources, and licensing components.

The classes in this namespace divide into the following categories:

114 questions
2
votes
1 answer

Creating custom activity design without reference to Design DLL in Windows Workflow Foundation

I am using Windows Workflow Foundation with custom Activities, and I would like to create custom Design for these activities in my workflow. I am able to make the design project, and the designer xaml. Also I am able to see the custom design for…
2
votes
1 answer

How do I collapse a Category attribute with System.ComponentModel?

I have a number of categories on my design time component that are being expanded by default. I'd like to have them appear collapsed by default, or at least problematically collapse them before the user sees them. [Category("Misc")] public int Id { …
2
votes
1 answer

How do I refresh the Properties Window in a Visual Studio extension?

I'm writing a Visual Studio extension that allows editing the properties of an object in the Properties Window. I use the ITrackSelection interface to select the object I want to edit, and it all works fine, the properties are shown in the window…
2
votes
2 answers

How to convert string to Color in SharePoint Client Object model for silverlight?

I need to convert a string which has the name of a color (e.g. "Red") to an object of System.Windows.Media.Color. I am using the following code: using System.ComponentModel; TypeConverter tc = new TypeConverter(); Color bgColor =…
2
votes
1 answer

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…
reshefm
  • 6,017
  • 8
  • 36
  • 40
1
vote
1 answer

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…
NileshChauhan
  • 5,469
  • 2
  • 29
  • 43
1
vote
2 answers

How to use a static utility method for property setters in a utility class

I'm trying to achieve two-way binding between a DataGridView and a BindingList that provides data for the DGV. Some columns do not yet reflect changes in the underlying list and I think it's because I have not provided property setter(s) to notify…
1
vote
0 answers

How to subclass System.ComponentModel.GroupDescription?

Can anyone explain how to use the GroupDescription class of the .NET library to implement anything else than (a class like) the PropertyGroupDescription class? In other words: What other kinds of grouping are possible by subclassing…
Arne
  • 51
  • 3
1
vote
1 answer

Checking property name at compile time in lambda expression

In a previous question of mine, Linq expressions and extension methods to get property name I asked about data binding between two POCO properties using expressions and extensions. I got a helpful anser and it is working fine but I have a question…
Flack
  • 5,727
  • 14
  • 69
  • 104
1
vote
0 answers

Add attribute to all properties of a class and its descendants

I'm working with workflow foundation and I have a base CodeActivity that is super class of all my activities. I'm adding Category as 'input' or 'output' to properties to ease the work of those using the activities. Example: public class MyActivity…
1
vote
0 answers

Passing variables inside React components issue with an onChange HTML element

How is the Search component being passed on to the second subcomponent? I am unable to pass an onChange of the text field from my subcomponent to my main index.js, any input appreciated. Code from two different files [Main] render () { return…
1
vote
0 answers

How to get WPF XAML Designer to play nicely with IValidatableObject from NET Standard 2.0 libraries?

Background: using Visual Studio 2017 v15.4 (no ReSharper or any weird extensions) Repro solution includes 2 projects: WPF project: .NET 4.6.1, using NuGet PackageReference format Class library: NET Standard 2.0 Both projects have the…
BCA
  • 7,776
  • 3
  • 38
  • 53
1
vote
1 answer

Is there a way to access an ITypeDescriptorContext or an IServiceProvider object from a custom TypeDescriptionProvider?

It seems like an odd gap in the TypeDescriptor dynamic metadata architecture. All of the TypeConverter, UITypeEditor and other dynamic designers, editors and converter classes provide access to an IServiceProvider object which allows for design…
glopes
  • 4,038
  • 3
  • 26
  • 29
1
vote
0 answers

Overriding error messages for all validation attributes

I'm usingSystem.ComponentModel.DataAnnotations attributes for validation but want to get error messages not from hard-coded strings or resources but from external service. The solution I've found so far requires too much code - create adapter…
synapse
  • 5,588
  • 6
  • 35
  • 65
1
vote
1 answer

How can I use the same CompositionConainer object (or it's contained assemblies) across my solution?

Let me explain a very simplistic example of what I need. Let's say that I have a VS solution that uses MEF and has the following, broad structure of projects and classes. Server (Project) Server.cs (Contains Main method, for launching the…
RLH
  • 15,230
  • 22
  • 98
  • 182