![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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) |
| Newbie | Accessing an Array element(i) from a XAML "binding path" Hi, I"m using WPF and trying to access an array element from my XAML Binding Path. I've got a class AuctionItem with an integer array named index and a integer named index0. <DataTemplate DataType="{x:Type src:AuctionItem}"> ... I can access a property named "index0", but I want to access "index(0)" This works: <TextBox Name="DescriptionEntryForm" Grid.Row="0" Grid.Column="4" Text="{Binding Path=index0, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource textStyleTextBox}" /> But I would like this to work instead: <TextBox Name="DescriptionEntryForm1" Grid.Row="0" Grid.Column="4" Text="{Binding Path=index(0), UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource textStyleTextBox}" /> Thanks for you help. Patrick |
| | #2 (permalink) |
| Guest | Re: Accessing an Array element(i) from a XAML "binding path" You need to use C# syntax for the indexer: <TextBox Name="DescriptionEntryForm1" Grid.Row="0" Grid.Column="4" Text="{Binding Path=index[0], UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource textStyleTextBox}" /> So, instead of index(0), it should be index[0]. --Aaron http://www.wiredprairie.us "iterationx" <iterationx.2msccl@no-mx.forums.net> wrote in message news:iterationx.2msccl@no-mx.forums.net... > > Hi, > I"m using WPF and trying to access an array element from my XAML > Binding Path. I've got a class AuctionItem with an integer array named > index and a integer named index0. > > <DataTemplate DataType="{x:Type src:AuctionItem}"> > .. > > I can access a property named "index0", but I want to access "index(0)" > > This works: > <TextBox Name="DescriptionEntryForm" Grid.Row="0" Grid.Column="4" > Text="{Binding Path=index0, UpdateSourceTrigger=PropertyChanged}" > Style="{StaticResource textStyleTextBox}" /> > > But I would like this to work instead: > <TextBox Name="DescriptionEntryForm1" Grid.Row="0" Grid.Column="4" > Text="{Binding Path=index(0), UpdateSourceTrigger=PropertyChanged}" > Style="{StaticResource textStyleTextBox}" /> > > Thanks for you help. > Patrick > > > -- > iterationx |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| When I start my computer I get an "array index error" | Gabriela | Vista installation & setup | 17 | 09-16-2007 01:32 PM |
| "Open command prompt here" and "Copy as path" | Moody Marco | Vista performance & maintenance | 10 | 05-04-2007 11:41 AM |
| Interpreter demo loading "loose Xaml" interface | pfisk | Avalon | 0 | 05-06-2006 03:24 PM |
| How to force KeyboardNavigation's "current element" ??? | Marcus | Avalon | 0 | 04-28-2006 12:18 PM |