Questions tagged [attached-properties]

In Windows Presentation Foundation (WPF), attached properties are a specialized form of dependency property that does not have the conventional property "wrapper".

An attached property is intended to be used as a type of global property that is settable on any object. It allows different child elements to specify unique values for a property that is actually defined in a parent element (Grid.Row and Grid.Column are an example of frequenly used attached dependency properties).

General information: Attached Properties Overview

458 questions
3
votes
1 answer

Set custom attached property in style setter

Im trying to set attached property inside a style, i want to use them to attach behaviour. However I cant get it to work. Heres code: Attached property public class TestBehaviour { public static bool GetTest(Grid grid) { return…
3
votes
1 answer

WPF trigger on attached property not working

i'm trying to change an image which i put as button's content through an attached property, yet for some reason the image is not changing and i don't get any exceptions or anything solid in the output. Here is my attached property class code: public…
user1531186
  • 323
  • 1
  • 7
  • 20
3
votes
2 answers

Silverlight ComboBox Attached Behavior

I am trying to create an attached behavior that can be applied to a Silverlight ComboBox. My behavior is this: using System.Windows.Controls; using System.Windows; using System.Windows.Controls.Primitives; namespace AttachedBehaviours { public…
3
votes
1 answer

Is there a way to control the Dependency Property Binding order value updates?

Is there a way to manipulate to order in which Dependency Properties receive their values : XAML :
eran otzap
  • 12,293
  • 20
  • 84
  • 139
3
votes
1 answer

Binding text to attached property

My question is similar to this: WPF Generate TextBlock Inlines but I don't have enough reputation to comment. Here is the attached property class: public class Attached { public static readonly DependencyProperty FormattedTextProperty =…
sfaust
  • 2,089
  • 28
  • 54
3
votes
1 answer

Bind Canvas.Left and Canvas.Top in Style

I am trying to reflect a position from my view-model expressing the location of an object in my view by binding the Canvas.Left and Canvas.Top properties in the style of the item view to appropriate properties in the view-model. However, the…
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
3
votes
0 answers

Can I use my own AttachedProperty as the StoryBoard.TargetProperty?

One of the controls in my view shall have the AttachedProperty "FocusClaim" set to true as soon as the VisualState "Prepared" is activated. The msdn documentation says I'm allowed to use AttachedProperties, I just have to give ownerType and…
Martin
  • 5,714
  • 2
  • 21
  • 41
3
votes
1 answer

Do you have a real world example of AttachedPropertyBrowsableWhenAttributePresentAttribute usage?

I just come across AttachedPropertyBrowsableWhenAttributePresentAttribute, but can't think of when it would be useful. Any ideals?
Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317
3
votes
1 answer

XAML:The attachable property VisualStateGroups was not found in type VisualStateManager

I'm using VS2008 EE SP1 + WPF + XAML. In the beginning I added a reference to it: xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" I'm getting this error while compilation:
Ivri
  • 2,159
  • 5
  • 25
  • 33
3
votes
3 answers

How to serialize attached properties

I am writing .NET3.5, WPF application using Composite Application Library. Application is divided into several modules. In infrastructure module I have defined NetworkNode object. The Network module manages a collection of NetworkNodes and uses…
Zefo
  • 217
  • 1
  • 3
  • 7
3
votes
1 answer

(MVVM-light) style.triggers dont works

I'm doing WPF(MVVM) project using mvvm-light libraries, and have such problem: I want to create style trigger dependent on value from my ModelView, but it's do not works XAML Part :