Some functions change the value of a TextBlock
in the ListView
. I want to access TextBlock
value at the end of these functions. How can I do it?
ListView code :
<ListView BorderThickness="0" x:Name="OrderList">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Grid Background="{TemplateBinding Background}">
<Border BorderBrush="{StaticResource MenuluxRedBrush}" BorderThickness="0,0,0,1" Height="30">
<local:OrderPopUpItem/>
</Border>
<GridViewRowPresenter Grid.RowSpan="2"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
OrderPopUpItem.xaml code :
<Grid Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding productName}"
VerticalAlignment="Center"
Margin="15,0,0,0"
FontSize="20"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="/Images/PopUp/icon_minus_red.png"
MouseLeftButtonUp="azalt"
Name="minusIcon"
Height="30"/>
<TextBlock Text="0"
Grid.Column="1"
Name="amountText"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="20"/>
<Image Source="/Images/PopUp/icon_plus_red.png"
MouseLeftButtonUp="arttir"
Name="plusIcon"
Grid.Column="2"
Height="30"/>
</Grid>