I have below listbox to which i am binding data from a class(SavedDataClass) defined.When user clicks on link "Update" i want to access the entire data of other members of that particular instance of SavedDataClass .Is that possible to access the data like that ? I mean how to access other xxaml controls data in a listbox item instance when one of its member is invoked ..
<ListBox x:Name="lstAreaDetails" Grid.Row="1" Margin="0,10,0,0" >
<ListBox.ItemTemplate >
<DataTemplate >
<StackPanel >
<StackPanel Orientation="Horizontal">
<TextBlock Foreground="White" Name="MyDateTime" Text="{Binding MyDateTime}"></TextBlock>
</StackPanel>
<StackPanel >
<HyperlinkButton Content="{Binding SavedName}" Name="lnkSAvedName" Click="HyperlinkButton_Click_1" />
<HyperlinkButton Content="{Binding Update}" Name="lnkUpdate" Click="lnkUpdate_click"/>
</StackPanel>
<TextBlock Text="{Binding ResAddress}" Name="txtResAddress" TextWrapping="Wrap" ></TextBlock>
<TextBlock >OtherDetails:</TextBlock>
<TextBlock Text="{Binding Area}" Name="txtArea" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
public class SavedDataClass
{
public string MyDateTime { get; set; }
public string SavedName { get; set; }
public string Update{ get; set; }
public string ResAddress { get; set; }
public string Area{ get; set; }
public string OptionalAddressLine1{ get; set; }
public string OptionalAddressLine2{ get; set; }
}
update link click will have below event handler:
private void lnkUpdate_click(object sender, RoutedEventArgs e)
{
//here I want to access other controls data e.g. MyDateTime,SavedName,ResAddress,Area,OptionalAddressLine1,OptionalAddresLine2
}