property

Technical code into the ViewModel in wpf ?

I have a UserControl with some custom dependency properties bound to a clr property in the ViewModel. The ViewModel has application logic where I deal with the TextPointer/TextRange classes with a FlowDocument. Should I put that stuff into the code-behind of the UserControl or in the ViewModel? ranges.Clear(); TextRange ran...

Cannot get PropertyInfo.SetValue() to set the value on my object.

I've simplified the code below down to a basic example, but I still cannot get the value to set. When performing the propertyInfo.SetValue(), it will hit a breakpoint on the setter of my Contact object and the value is set correctly in the 'setter.' However, after the SetValue() has executed, the string properties on my projectContact....

Silverlight dependency property snafu, what am I doing wrong?

I'm enhancing an open source control to add some functionality that I need, and I'm getting hopelessly tangled up in the following problem: The control is a rich textbox that supports HTML but not via a property; you have to do something like this: var sHtml = "..." ctrl.LoadHtml(sHtml) and var sHtml = ctrl.SaveHtml() So far so go...

Updating property in PropertyGrid when value of property is changed elsewhere?

Hey guys, We have an object that is assigned to a PropertyGrid using the SelectedObject property of the PropertyGrid. This object contains a few properties which get updated by code in various places. For the purpose of this example, assume one is a simple update (ie: caused by the following code - Person.FirstName = "Gareth"), and that...

Is it safe to delete an object property while iterating over them?

When iterating over an object's properties, is it safe to delete them while in a for-in loop? For example: for (var key in obj) { if (!obj.hasOwnProperty(key)) continue; if (shouldDelete(obj[key])) { delete obj[key]; } } In many other languages iterating over an array or dictionary and deleting inside that is uns...

In Objective-C on iOS, what is the (style) difference between "self.foo" and "foo" when using synthesized getters?

I have searched many questions on ObjC accessors and synthesized accessors to no avail. This question is more of a "help me settle an issue" question; I don't expect one answer, but I'm rather looking for experts to weigh in on the argument. In a Cocoa Touch class, I would write some code like this (where soundEffects is a synthesized ...

Interface inheritance: is extending properties possible?

I want to do this: interface IBase { string Property1 { get; } } interface IInherited : IBase { string Property1 { get; set; } } So that IInherited would have the inherited property Property1 with added functionality to allow set. Is that possible? What's the syntax? EDIT: please notice I put the word "inherited" in bold fa...

UpdateAnimationExtender Property Key - What properties are available to me?

Hello all. I have the following generic .net code to change the background colour of a label. Lovely. <asp:UpdatePanelAnimationExtender ID="UpdatePanel1_UpdatePanelAnimationExtender" runat="server" Enabled="True" TargetControlID="UpdatePanel1"> <Animations> <OnUpdating> <Color AnimationTarge...

How can I get the name of a C# static class property using reflection?

I want to make a C# Dictionary in which the key is the string name of a static property in a class and the value is the value of the property. Given a static property in the class called MyResources.TOKEN_ONE, how can I get the at the name of the property rather than its value? I only care about the end part of the property name (e.g. ...

C#, ArrayList Property to List field

Hello, I have the following Field: private IList<Modulo> modulos; and the following Property: public virtual ArrayList XmlModulos { get { if (modulos == null) return new ArrayList(); var aux = new ArrayList(); foreach (Modulo m in modulos) aux.Add(m); ...

Sharepoint 2010 WebPart: Users in Site Members Group can't save property of web part

I've created some custom property for my web part with Personalizable(PersonalizationScope.User) attribute. I changing this property in EditorPartClass in ApplyChanges() Method only. The main problem is user with contribute permission for a site can't save this property when editing personalized view of a page. Changing property applies ...

c# binding (complex) class property CF.NET

Hi, I am trying to make a 2-way binding of a class property. public class MyClass{ public MyField AField1{get;set;}; public MyField AField2{get;set;}; } public class MyField{ public string Value {get; set} } MyClass _class = MyClass(); _dv.DataSource = _class; Databinding text object displays MyField class name instead of Value Prop...

Implementing a Tag property on entity classes

When I create entities in a class library, I tend to add a Tag property which may be used by users and extending libraries to store arbitrary data with the object. Now I am looking for the best way to implement such a Tag property in my class library, and the reasons why. In System.Windows.Forms, Microsoft uses object Tag { get; set; } ...

C# typed Object input/output property connection graph - Quartz Composer style implementation

The first part of the problem is that I don't know if there's a specific name for a system like this :) In my app I need a system to give the user the ability to interconnect object-properties; objects can have inputs and outputs, and inputs of one object can be connected to outputs of other objects. Optionally type-converters can be us...

Declaring private member variables

I've started learning Objective-C a few weeks ago and I still don't understand how to manage the encapsulation of a class correctly. What is the best way to declare a private member variable in a class? It seems that setting the right getter/setter for your member variable with "@property" is the right way to go, more than just declarin...

semantic mediawiki property calculation

Hi, I installed the MediaWiki-extension Semantic MediaWiki recently. In this extension you can define properties. They are like categories for values. If I define two properties like this: [[StartYear::2000]] [[EndYear::2005]] Is it possible to make calculations based on these properties if I do a semantic search. For example: {{#a...

Visio Question? Is there a way to set the property of something to Always be in Front?

So you can arrange items to be in the back or front, is there a way to set it to always be Front? ...

Passing properties as parameters

I want to create a generalized helper method for LoadFromXML loading and validation. If the XML I'm loading from is incomplete, I do want it to fail completely without throwing an exception. Currently, my code looks like this (more or less) public override bool Load(XElement source) { return new List<Func<XElement, bool>> { ...

Class only writable by "parent" class, but readable by other classes

I'm using C#, with which I don't have a lot of experience (I've mostly worked with java/php/javascript so far) What I want is a class in which I save some data, this data can only be written by one other class, but still be read by other classes in the program. Something like this: public class DataObtainer{ DataItem[] Items; public...

UseMnemonic property of a GroupBox in C#.Net 2010

I use a GroupBox and its text property is supposed to be "Word1 & Word2". But it seems the UseMnemonic feature takes effective that the result looks like "Word _Word2". So how can I disable UseMnemonic feature of a GroupBox? Or any workaround. (I know there is property UseMnemonic for a Button control, but I cannot find the correspond...