Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

syntax question with attached property

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 07-17-2007   #1 (permalink)
Lloyd Dupont
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 SpecsSystem Spec
Old 07-21-2007   #2 (permalink)
thelemmings@gmail.com
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 SpecsSystem Spec
Old 07-21-2007   #3 (permalink)
Lloyd Dupont
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 SpecsSystem Spec
Closed Thread

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51