![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | How to reference another element in the same XAML file? Say, MyControl is a custom control which have a property of type Button. How could I set this property to myButton? I think is maybe like this: <Button name="myButton">ClickMe</Button> <MyControl buttonProp="myButton"/> |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: How to reference another element in the same XAML file? If buttonProp is a dependency proprty you can use Data Binding: <Button Name="myButton">ClickMe</Button> <MyControl buttonProp="{Binding ElementName=myButton}"/> If its an ordinary CLR property, I think even in this case you'll have to do it from code-behind. <Button Name="myButton">ClickMe</Button> <MyControl Name="myControl" /> myControl.buttonProp = myButton; - Doug "TyraelTong" <TyraelTong@gmail.com> wrote in message news:1159361103.159994.47290@h48g2000cwc.googlegroups.com... > Say, MyControl is a custom control which have a property of type > Button. How could I set this property to myButton? I think is maybe > like this: > > <Button name="myButton">ClickMe</Button> > <MyControl buttonProp="myButton"/> > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: How to reference another element in the same XAML file? If buttonProp is a dependency proprty you can use Data Binding: <Button Name="myButton">ClickMe</Button> <MyControl buttonProp="{Binding ElementName=myButton}"/> If its an ordinary CLR property, I think even in this case you'll have to do it from code-behind. <Button Name="myButton">ClickMe</Button> <MyControl Name="myControl" /> myControl.buttonProp = myButton; - Doug "TyraelTong" <TyraelTong@gmail.com> wrote in message news:1159361103.159994.47290@h48g2000cwc.googlegroups.com... > Say, MyControl is a custom control which have a property of type > Button. How could I set this property to myButton? I think is maybe > like this: > > <Button name="myButton">ClickMe</Button> > <MyControl buttonProp="myButton"/> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble with resize ratio of XAML element | Mike D | Avalon | 0 | 02-18-2008 03:03 AM |
| Can you reference a XAML Resource from an External Assembly? | wackyphill@yahoo.com | Avalon | 3 | 02-05-2007 06:52 AM |
| Best way to reference ConfigurationManager.AppSettings in XAML | Keith Patrick | Avalon | 0 | 12-19-2006 02:19 PM |
| Custom Window as a XAML root element! | deepforest | Avalon | 2 | 11-23-2006 10:16 AM |
| Reference a xaml window from a WinFX Custom Control Library ? | Peter Fitzgibbons | Avalon | 3 | 02-24-2006 04:11 PM |