Hi,
VS has thrown a useless exception which I think is caused by the fact I have multiple DP's in two similar classes with the same name.
the classes are add/edit contact so they share a number of properties, my problem is this.
I can register a property as:
DependancyProperty.Register( /*...*/ );
or:
MyDP.AddOwner( /*...*/ )
pr...
I have a custom login usercontrol that has a normal textbox and a passwordbox.
Blend refuses to cooperate with the passwordbox saying that "DP.UnsetValue" is not valid for PasswordChar property. However the project compiles and runs fine in blend or in VS2010. The cider designer in vs2010 doesn't seem to mind the error because it actua...
When I use the following line, implementing a templated control from a Silverlight class library;
<labelSliderControl:SliderControl x:Name="sldX" Label="X" Value="4" />
I see in the VS Disign view the Slider getting the value of 4. But when I run the app the Slider starts at 0. So when I change the attribute in XAML I can see the c...
Hi, I would like to arrange items of a collection in a grid with a specific number of columns and rows (say 4x6). Each item exposes the dependency properties (integer) X and Y and should be placed in the relevant cell of the grid. Note that the collection can change during runtime which should update the grid items.
I couldn't find any ...
I have a WPF application where I'm using dependency properties in codebehind which I want to set via XAML declarations.
e.g.
<l:SelectControl StateType="A" Text="Hello"/>
So in this example I have a UserControl called SelectControl, which has a property called StateType which manipulate some other properties in it's setter.
To help...
In a poco view model I might have a calculated property that pulls data from several different properties inside its get. When these properties values change I need to remember to call OnNotifyPropertyChanged for the calculated property. I was thinking that any line of code where I say NotifyPropertyChanged is not testable code, so I a...
I'm just getting started with WPF.
I have TextBox declared in xmal like so:
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=TestComplex.Something, Mode=TwoWay}"/>
In my code behind I have registered the property that I am trying to bind to like so:
public TestComplexObject TestComplex
{
get { return (TestComplex...
Using Spring IoC allows to set bean properties exposed via setters:
public class Bean {
private String value;
public void setValue(String value) {
this.value = value;
}
}
And the bean definition is:
<bean class="Bean">
<property name="value" value="Hello!">
</bean>
Is there any existing plugins/classes for S...
Hi,
I need to create a dependency property on a custom control. The problem is that the propertyChangedCallback does not get called when the collection changes. How should I properly handle this scenario?
I am afraid of memory leaks caused by simply event hooking to the CollectionChanged event during the initial property change (when t...
Suppose you have a class inheriting from ValidationRule:
public class MyValidationRule : ValidationRule
{
public string ValidationType { get; set; }
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{}
}
in XAML you are validating like this:
<ComboBox.SelectedItem>
<Binding Path="MyPath...
I have used DependencyProperty to pass value from textbox at silverlight page to external silverlight user control located in same page and that works fine.
But the problem is I could not bind the Textbox in page in reverse way. i.e. when i need to have changes in parent page when its usercontrol's textbox text is changed.
The XAML:
...
I have this method fired on a button click. MyObj is an extended Control type with two properties CenterX and CenterY with backing dp CenterXProperty and CenterYProperty.
With the animation playing the CenterX and CenterY properties of MyObj are changing, but I can't see any movement of the object.
private void MoveMyObjectsWithAnimat...
I have a property on a Silverlight control that a ViewModel wants to bind to. The ViewModel need to told of changes to the property NOT the other way around
Syntax like
<MyControl ViewPort="{Binding VMProperty}"/>
Declares ViewPort as the Target, in this instance ViewPort is the source of the data. I know I could make it TwoWay bind...
We have a custom panel class that animates its children via an internal DoubleAnimation object. However, we want to expose the animation's Duration dependency property as a public property of our panel so the user can change it in their XAML when using our panel. But we don't want to expose any other part of the animation object, just ...
The background
Maybe it is not necessary, but I am afraid that single line question would be too complex.
So... I had min-max generic range validator (RangeValidator), because XAML does not work with generic classes I created simple derivative IntRangeValidator which would set int as generic type, because in current case I need validat...
I have next dependency property:
public static DependencyProperty RequestObjectProperty = DependencyProperty.Register("RequestObject", typeof(RegistrationCardSearch), typeof(RegCardSearchForm),new UIPropertyMetadata(Changed));
private static void Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Me...
I have a usercontrol with a dependencyproperty that takes oen UIElement. So fare so good, the problem is I can not find the element's children.
I think the problem is my lack of knowledge, could anyone tell me what the problem is and a possible solution?
I have made a small test-program like this
Usercontrol codebehinde:
public UIEle...
I have been reading on Dependency properties for a few days and understand how they retrieve the value rather than to set/get them as in CLR properties. Feel free to correct me if I am wrong.
From my understanding all WPF controls like a TextBlock, Button etc that derive from DependencyObject would also contain dependency properties to ...
I've added a dependency property to my view base class, that is supposed to allow the child UserControls to set some properties on the parent window, one being SizeToContent. When my OnSizeToContent method runs, when it tries to change the main windows's SizeToContent from WidthAndHeight to Manual, I get this odd error:
FatalExecutionEn...
I have a DataTemplate that needs to set the IsSelected property on an ItemsControl's container (such as TreeViewItem, ListViewItem or ComboBoxItem). However, it doesn't know the type of the container until it's passed in to it. Since IsSelected isn't part of a common base class or interface, nor is it a common dependency property regis...