Bonjour à tous,
j'ai un petit soucis sur une listbox
j'ai un tabcontrol qui contient une listbox que je charge via un binding
XAML :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <ListBox x:Name="ListePictos" ItemsSource="{Binding}"
SelectionMode="Single" SelectionChanged="ListePictos_SelectionChanged" Width="920"
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Auto"
>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type local:MonObjet}">
<StackPanel x:Name="stack" Width="110" Height="90" Background="Transparent">
<Image Source="{Binding Path=FullPath}" Width="75" Height="65" Stretch="Fill" />
<Label HorizontalContentAlignment="Center" Content="{Binding Path=Nom}" Width="100" Height="25" FontSize="10" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox> |
je charge ma listBox via
listbox.ItemsSource = ObservableCollection<MonObjet>;
ensuite je décharge ma listbox en faisant ceci
listbox.ItemsSource = null;
ensuite je veux changer le nom de mes images qui sont chargées dans le listbox via
mais j'ai une erreur qui me dis :
Le processus ne peut pas accéder au fichier, car il est utilisé par un autre processus.
en espérant avoir était assé clair pour que l'on puisse m'aider
merci d'avance
comment faire pour bien décharger la listbox et les images du template ??
merci d'avance
Partager