Questions tagged [dependency-properties]

A property in WPF and Silverlight that can be set through methods such as, styling, data binding, animation, and inheritance.

Dependency property is a property backed by a static DependencyProperty instance.

The purpose of dependency properties is to provide a way to compute the value of a property based on the value of other inputs and to provide notification when computed value changes. The priority of inputs which contribute to computation is listed in Dependency Property value precedence overview.

Dependency properties usually have CLR "wrappers": the actual get and set implementations for the property.

Dependency property declaration (static field + wrapper) is a boilerplate code, which follows a certain pattern and can be generated by IDE (check Visual Studio shortcuts here).

General information: Dependency Property Overview

2294 questions
0
votes
3 answers

Dependency Property - Inheriting from another property?

I've got a custom dependency property in my WPF UserControl called CustomForeground. I'd like it to fallback to UserControl.ForeGround if no value is specified on CustomForeground. I'm using the following code, which works, but it definitely feels…
maxp
  • 24,209
  • 39
  • 123
  • 201
0
votes
0 answers

Dependency property nerver set when binding with a custom object

I'm trying to bind passing the custom object of type "CommandButton_VModel" to an User control through a dependency property, but it seems the setter of this dp is never hit. I mean at the user control the dependency property is always null, could…
0
votes
0 answers

Delay with WPF Binding

I'm trying to create a ProgressBar that can animate from 0 to some value. Everything works fine most of time ... I'm using the code from Owen Johnson. Have some changes like: public static readonly DependencyProperty SmoothValueProperty = …
Kevin Kouketsu
  • 786
  • 6
  • 20
0
votes
1 answer

How to bind to another's object property with XAML Style Template?

Let's say I have the following class: public class MyClass : System.Windows.FrameworkElement { public static readonly DependencyProperty HasFocusProperty = DependencyProperty.RegisterAttached("HasFocus", typeof(bool), typeof(MyClass), new…
mu88
  • 4,156
  • 1
  • 23
  • 47
0
votes
1 answer

In UWP, what is the equivalent of DependencyType property of DependencyProperty Class of WPF?

After migrating a WPF class library to a UWP class library, the following code is throwing an error. The PropertyType property of DependencyProperty class worked in WPF. I tried to get help from Dependency properties overview of similar class in UWP…
nam
  • 21,967
  • 37
  • 158
  • 332
0
votes
1 answer

Silverlight: Binding to UserControl's dependency properties

I have an user control named GraphPanel. It has two dependency properties, one custom, PanelTitle, and the other inherited from the FrameworkElement, Content. public static readonly DependencyProperty PanelTitleProperty =…
Leonard
  • 3,012
  • 2
  • 31
  • 52
0
votes
0 answers

Memory leak on AddValueChanged of dependency property

My app open and closes several times the same view and everytime it gets sluggish and sluggish as the cycle goes on. If I don't attach any handler to the ValueChanged event on my DependencyProperty, the GC collects as expected. If I add it…
Faby
  • 21
  • 6
0
votes
1 answer

Designer process terminated in Custom Control with Binding Content

I have created a custom User Control from a Gruopbox. However, in order to be used as a container in a view, I must create a DependecyProperty for the Content. This results in an Unhandled Exception has occurred error in VS2017. This however, only…
Albert Alonso
  • 656
  • 1
  • 6
  • 21
0
votes
1 answer

Telerik PersistenceFramework: RadGridView PersistenceManager.StorageId

I'm trying to use telerik:PersistenceManager.StorageId property on RadGridView to persist the component status in the local storage. If I set the property like this: telerik:PersistenceManager.StorageId="rgvItems" all works fine but I would like to…
0
votes
1 answer

wpf binding synchronization across different controls in separate windows

I have three windows in whose i need a single value synchronized. I need to update the selected item across thre windows. Two of them containing a combobox and the main window containing a label. Thus, i need the two comboboxes to be identical and…
RubenDFC
  • 35
  • 7
0
votes
2 answers

Trying to bind whole Window to Usercontrol

I'm trying to bind my whole window to a underlying usercontrol to let that usercontrol control parent window behaviour. For example i would like to close the parent window from the userControl. I want to create a custom TitleBar that i can reuse in…
Bjorn
  • 181
  • 2
  • 11
0
votes
0 answers

Spring property Inject full property object to bean

Ihave property class: @Getter @Setter @Component @ConfigurationProperties(prefix = "my-api") public class MyApiProperties { ... private MyClient myClient; @Getter @Setter public static class MyClient { private String…
ip696
  • 6,574
  • 12
  • 65
  • 128
0
votes
3 answers

Trying to Understand Dependency Properties

I have been trying to understand and get something working with dependency properties. I have read loads of descriptions and explanations about DP's, and I also think I understand where they should be used. I have read this and the links /…
S Rosam
  • 375
  • 1
  • 3
  • 16
0
votes
2 answers

Using the Same FrameworkPropertyMetaData more than once

I have 3 dependancy Properties and a FrameworkPropertyMetadata, I get a crash when I try to use the metadata on more than one DP. I dont want to have 3 duplicates of the metadatam is there a way around this. static FrameworkPropertyMetadata…
Eamonn McEvoy
  • 8,876
  • 14
  • 53
  • 83
0
votes
3 answers

Update binding without DependencyProperty

I have a lot of existing business objects with many properties and collections inside which I want to bind the userinterface to. Using DependencyProperty or ObservableCollections inside these objects is not an option. As I know exactly when I modify…
MTR
  • 1,690
  • 3
  • 20
  • 47
1 2 3
99
100