I have this data template in my wpf xaml to add items to my listbox.
How can I via VB.NET code access the Caty_Name when one is selected?
wpf Code:
<DataTemplate x:Key="Caty" x:Name="CatyItem"> <Border Background="White" BorderBrush="Black" BorderThickness="2" CornerRadius="15" Padding="10px" Margin="5px"> <Grid> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition Height="3px"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="30px"></ColumnDefinition> <ColumnDefinition Width="200px"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBlock Grid.Column="1" Grid.Row="0" Margin="2" Foreground="Black" Text="{Binding Path=Name}"></TextBlock> <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="2"> <TextBlock Foreground="Black" x:Name="Caty_ID" Text="Catalogue ID:"></TextBlock> <TextBlock Foreground="Black" x:Name="Caty_Name" Text="{Binding Path=CatalogueID}"></TextBlock> </StackPanel> <Image Grid.RowSpan="2" Grid.Column="0" Grid.Row="0" Height="30px" Width="30px" Source="catalog.gif"></Image> </Grid> </Border> </DataTemplate>




Reply With Quote