![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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 |
My System Specs![]() |
| | #2 (permalink) |
| | 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 |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| "the application binding data format is invalid" while attempting to install SP2 | Windows Updates | |||
| Array indexing: Want to say "Item #2 through the rest of the array." | PowerShell | |||
| "Open command prompt here" and "Copy as path" | Vista performance & maintenance | |||