I have a ListView which is created by class in ObservableCollection
public class ImageClass { public int Id { get; set; } public string ImagePath { get; set; } } Collection: PhotoList = new ObservableCollection<ImageClass>(); Well, actually filling: ImageList.ItemsSource = PhotoList;
ListView:
<ListView x:Name="ImageList" > <ListView.ItemTemplate> <DataTemplate> <StackPanel HorizontalAlignment="Stretch" Margin="0,0,0,9"> <Image Height="Auto" HorizontalAlignment="Stretch" Source="{Binding ImagePath}" /> <StackPanel Orientation="Horizontal" Height="50" Background="#FFC2C9D0" HorizontalAlignment="Stretch"> <RadioButton GroupName="State" FontSize="25" Content="-" /> <RadioButton GroupName="State" FontSize="25" Content="+;" VerticalAlignment="Stretch" /> </StackPanel> </StackPanel> </DataTemplate> </ListView.ItemTemplate> </ListView> And I can’t figure out how to make RadioButton + or - pressing this data somehow saved (for example, in the class where the link to the image lies) the selected RadioButton were in the same down position. The main difficulty is how to write RadioButton data to the desired one from the many created ImageClass. Please push the thought :)
