WPF

An ObservableCollection in WPF is a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed. It’s especially useful for data binding in applications because it automatically updates the UI when the data in the collection changes.

Here are some key points about ObservableCollection:




To rotate an image indefinitely in WPF using XAML 



<Window x:Class="WpfApp.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="350" Width="525">

    <Grid>

        <Image Source="your_image.png" Width="200" Height="200">

            <Image.RenderTransform>

                <RotateTransform x:Name="rotateTransform" CenterX="100" CenterY="100"/>

            </Image.RenderTransform>

            <Image.Triggers>

                <EventTrigger RoutedEvent="Image.Loaded">

                    <BeginStoryboard>

                        <Storyboard>

                            <DoubleAnimation

                                Storyboard.TargetName="rotateTransform"

                                Storyboard.TargetProperty="Angle"

                                From="0" To="360" Duration="0:0:5"

                                RepeatBehavior="Forever"/>

                        </Storyboard>

                    </BeginStoryboard>

                </EventTrigger>

            </Image.Triggers>

        </Image>

    </Grid>

</Window>