![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | syntax question with attached property In XAML I could write: <Button DockPanel.Dock="Top" Content="OK" /> or <Button DockPanel.Dock="Top" /> <Button.Content> OK </Button.Content> </Button> but how could I use the same syntax as above with attached property? is there something like: <Button Content="OK" /> <Button.DockPanel.Dock> Top </Button.DockPanel.Dock> </Button> |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: syntax question with attached property Hi, I don't think you can do that. Only an object's own properties can be written as children XAML elements. In your example, as DockPanel.Dock is an attached property, and not a Button-owned property, it can only be expressed as an attribute. Luc On Jul 18, 5:59 am, "Lloyd Dupont" <net.galador@ld> wrote: > In XAML I could write: > > <Button DockPanel.Dock="Top" Content="OK" /> > > or > > <Button DockPanel.Dock="Top" /> > <Button.Content> > OK > </Button.Content> > </Button> > > but how could I use the same syntax as above with attached property? > is there something like: > > <Button Content="OK" /> > <Button.DockPanel.Dock> > Top > </Button.DockPanel.Dock> > </Button> |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: syntax question with attached property It turns out that you can!! like that, too easy! <Button Content="OK" /> <DockPanel.Dock>Top</DockPanel.Dock> </Button> <thelemmings@gmail.com> wrote in message news:1185016785.660653.160180@57g2000hsv.googlegroups.com... > Hi, > > I don't think you can do that. Only an object's own properties can be > written as children XAML elements. In your example, as DockPanel.Dock > is an attached property, and not a Button-owned property, it can only > be expressed as an attribute. > > Luc > > On Jul 18, 5:59 am, "Lloyd Dupont" <net.galador@ld> wrote: >> In XAML I could write: >> >> <Button DockPanel.Dock="Top" Content="OK" /> >> >> or >> >> <Button DockPanel.Dock="Top" /> >> <Button.Content> >> OK >> </Button.Content> >> </Button> >> >> but how could I use the same syntax as above with attached property? >> is there something like: >> >> <Button Content="OK" /> >> <Button.DockPanel.Dock> >> Top >> </Button.DockPanel.Dock> >> </Button> > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Attached property in Blend | Roman | Avalon | 0 | 07-30-2007 07:46 AM |
| Syntax of Pipleline question | Larry R | PowerShell | 2 | 05-01-2007 01:55 PM |
| Style trigger on attached property | Michael Latta | Avalon | 1 | 10-04-2006 07:25 AM |
| Syntax question | Jim Holbach | PowerShell | 2 | 06-08-2006 02:25 PM |
| Re: Data binding doesn't work for Property Tag syntax ? | Mikhail | Avalon | 0 | 01-10-2006 03:51 PM |