G
G
Grigory Boev2019-11-16 14:40:37
WPF
Grigory Boev, 2019-11-16 14:40:37

How to release the resources occupied by the program?

Good afternoon. I have a c# WPF program. In it I display pictures from the folder specified by the user.
After selecting the pictures, they must be renamed. The problem is that the program "captures" the files and I can't rename them while the program is running. Even if the list of files displayed in the listbox has already been cleared or changed (and here, in theory, nothing prevents renaming the files)
Is there a way to show files without blocking them?

<ListBox Name="imagesList" Margin="5"  Background="DarkGray">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding IsChecked}" Margin="5" BorderBrush="LightCyan" Width="128">
                        <StackPanel Orientation="Vertical">
                            <Image Width="128" Height="128" Source="{Binding FileName}"/>
                            <TextBlock Text="{Binding Text}"/>
                        </StackPanel>
                    </CheckBox>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question