dependency-properties

How to set the final value of an Animation to the property when the Animation finishes or is canceled?

I try to animate a DependencyProperty from a value to a target value (in code) and when the animation finishes (or is canceled) set the final value to the property. The final value would be either the To value if the animation finishes or the current computed value (by the animation) when the animation is canceled. By default the Animat...

Customizing The DependencyObject Inheritance Tree

I'm struggling to find sufficient information about the property Inheritance Tree (or Inheritence Context) used by DependencyObject and DependencyProperty. I would like to use the value inheritence capability of DependencyProperty outside of a typical WPF page, such that Object A is the logical parent Object B, and thus a value assigned...

What is a dependency property?

What is a dependency property in .Net (especially in WWF context). What is the difference from the regular property? ...

System.Windows.DependencyProperty vs. System.Workflow.Componentmodel.DependencyProperty

The .NET Framework seems to have two implementations of the DependencyProperty object System.Windows.DependencyProperty System.Workflow.ComponentModel.DependencyProperty I understand that the normal use of the first one is in WPF and the normal use of the second one is in WF but what are the differences between them if any? If I was ...

UserControl custom DependencyProperties problem

I have a custom UserControl with an image and a label, both of which are set at design-time in the XAML like so: <controls:HomeBarButton Icon="/SuCo;component/Resources/music.png" Text="music"/> When the control has just an Icon, it looks fine. When I add the Text property, the icon disappears at both design- and run-time and the text l...

What WPF dependency property should I bind to for finding the center of a FrameworkElement?

I'm writing a WPF application and I'm trying to figure out the best binding approach but have been coming up only "hack" solutions and I'm hoping there's a better way. I have a Border object (which derives from FrameworkElement) inside a Grid. The Border's size may change because of a child TextBlock's text changing. The Border's posi...

Dependency Property causing XamlParseException AG_E_PARSER_BAD_PROPERTY_VALUE

I've created two UserControls, the first of which displays a list of objects, the second of which displays details about an object that is selected from the first. I've created a dependency property on the first control and am binding each UserControl to an object declared in my Resources collection. I've seen blog posts describing this,...

How can I implement a "pass-through" DataBinding?

A little background: I am loading a WPF UI from a database which is stored in a table of properties (Control type, label, margin, etc.) which I load into a class I call ControlPresenter. Basically I set ControlPresenter as the DataContext of a ContentPresenter and use a TemplateSelector to choose which type of control to load. The DataTe...

How to bind to a WPF dependency property when the datacontext of the page is used for other bindings?

How to bind to a WPF dependency property when the datacontext of the page is used for other bindings? (Simple question) ...

WPF: Basic question about Dependency Properties

I have the following Xaml in a Window (ArtistInfo): <Grid> <TextBlock Text="{Binding Artist.Name}"></TextBlock> </Grid> And this is the code-behind for the same window (code simplified for question's sake): public static readonly DependencyProperty ArtistProperty = DependencyProperty.Register("Artist", typeof(Artist), ty...

WPF - What conditions must be met to use data binding in a custom control's content items?

I'm in the process of making a custom control -- specifically a pie chart. I want the markup to look something like this example: <c:PieChart> <!-- These dependency properties are never set --> <c:Slice Value="{Binding RedCount}" /> <c:Slice Value="{Binding BlueCount}" /> <c:Slice Value="{Binding GreenCount}" /> </c:Pie...

Custom Dependency Properties and TwoWay binding in WPF

We have an object that derives from DependencyObject, and implements some DependencyProperties. Basically something like this: class Context : DependencyObject { public static readonly DependencyProperty NameProperty = DependencyProperty.Register ("Name", typeof (string), typeof (Context), new PropertyMetadata ("")); public s...

determine if a wpf dependencyproperty value is inherited

Does anyone know how to determine if the value of a WPF property is inherited? In particular, I'm trying to determine if the DataContext of a FrameworkElement was inherited from the parent or set directly on the element itself. Thanks, - Mike ...

Silverlight: How to receive notification of a change in an inherited DependencyProperty

I have a control which inherits from (you guessed it) Control. I want to receive a notification whenever the FontSize or Style properties are changed. In WPF, I would do that by calling DependencyProperty.OverrideMetadata(). Of course, useful things like that have no place in Silverlight. So, how might one receive those kinds of notif...

WPF: Adding an element to a databound Collection (a Dependency Property)

I have this DependencyProperty which holds an entity with a property that is a collection (ShoutBox.Entities): public static readonly DependencyProperty ShoutBoxProperty = DependencyProperty.Register("ShoutBox",typeof (ShoutBox),typeof (ShoutBoxViewerControl)); public ShoutBox ShoutBox { get { return (ShoutBox) GetValue(ShoutBoxPro...

WPF Designer and Binding to Dependency Property problem

Hello all, I have a problem updating the WPF Designer when binding to custom dependency properties. In the following example, I create a simple Ellipse that I would like to fill with my custom MyAwesomeFill property. The MyAwesomeFill has a default value of a Yellow SolidColor brush. The problem is that in the control form of the des...

WPF Dependency Properties: Why do I need to specify an Owner Type?

This is how I register a DependencyProperty: public static readonly DependencyProperty UserProperty = DependencyProperty.Register("User", typeof (User), typeof (NewOnlineUserNotifier)); public...

Java .properties file, how to reference already defined property later, dir.default=/home/data/in/

define a default directory for Input files dir.default=/home/data/in/ dir.proj1=dir.default /p1 dir.proj2=dir.default /p2 dir.proj3=dir.default /p3 is this possible? ...

Binding Textbox IsFocused to Popup IsOpen plus additional conditions

I have a TextBox and a Popup control. I want the popup IsOpen property to be bound to the TextBox IsFocused property. In other words, if the textbox has focus, the popup is open. Alternatively, if the popup is in focus, I don't want it to close due to the textbox losing focus. I was hoping to handle this using bindings rather than havin...

How is dependency property implemented?

Hi, Can anyone explain how is dependency property implemented? Is it just a static dictionary that is declared in base class with a reference of given instance as a key?I can't find any resources about this in internet...Thanks a lot ...