PropertyChanged Calling the Changed Property’s Setter

I am currently learning .NET and WinUI3, and noticed that when changing the SelectedItem of a ListView and calling PropertyChanged, PropertyChanged calls the property’s setter. Am I doing something wrong?

public class MainViewModel : BindableBase
{
    #region Fields
    private string selectedMedium;
    public MediaItem SelectedMediaItem
    {
        get
        {
            Debug.WriteLine("This is SelectedMediaItem's getter.");
            return selectedMediaItem;
        }
        set
        {
            Debug.WriteLine("Calling SetProperty from SelectedMediaItem setter");
            SetProperty(ref selectedMediaItem, value);
            Debug.WriteLine("Done calling SetProperty");
        }
    }
}
public class BindableBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        Debug.WriteLine($"Invoking PropertyChanged from OnPropertyChanged, property being changed is: {propertyName}");
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        Debug.WriteLine("Done Invoking PropertyChanged");
    }
    protected bool SetProperty<T>(ref T originalValue, T newValue, [CallerMemberName] string propertyName = null)
    {
        if (Equals(originalValue, newValue))
        {
            Debug.WriteLine($"Values are the same, property name is {propertyName}, original value is {(originalValue as MyMediaCollection.Model.MediaItem)?.Name}, new value is {(newValue as MyMediaCollection.Model.MediaItem)?.Name}");
            return false;
        }
        Debug.WriteLine($"Values are not the same(good), property name is {propertyName}, original value is {(originalValue as MyMediaCollection.Model.MediaItem)?.Name}, new value is {(newValue as MyMediaCollection.Model.MediaItem)?.Name}");
        originalValue = newValue;
        Debug.WriteLine("Calling OnPropertyChanged from SetProperty");
        OnPropertyChanged(propertyName);
        return true;
    }
}

XAML:

<ListView
    Grid.Row="1"
    ItemsSource="{x:Bind ViewModel.Items}"
    SelectedItem="{x:Bind ViewModel.SelectedMediaItem, Mode=TwoWay}"
    Background="LightGoldenrodYellow">
    <ListView.HeaderTemplate>
        <DataTemplate>
            <Grid ColumnDefinitions="100,*">
                <Border BorderBrush="BlueViolet" 
                        BorderThickness="0,0,0,1">
                    <TextBlock Text="Medium"
                               Margin="5,0,0,0"
                               FontWeight="Bold"/>
                    
                </Border>
                <Border Grid.Column="1"
                        BorderBrush="BlueViolet"
                        BorderThickness="0,0,0,1">
                    <TextBlock Text="Title"
                               Margin="5,0,0,0"
                               FontWeight="Bold"/>
                </Border>
            </Grid>
        </DataTemplate>
    </ListView.HeaderTemplate>
    <ListView.ItemTemplate>
        <DataTemplate x:DataType="model:MediaItem">
            <Grid 
                ColumnDefinitions="100, *">
                <TextBlock Text="{x:Bind Path=MediumInfo.Name}"/>
                <TextBlock Grid.Column="1" Text="{x:Bind Path=Name}"/>
            </Grid>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

The following is the output when selecting an item inside the ListView:

This is SelectedMediaItem's getter.
Calling SetProperty from SelectedMediaItem setter
Values are not the same(good), property name is SelectedMediaItem, original value is , new value is The Mummy
Calling OnPropertyChanged from SetProperty
Invoking PropertyChanged from OnPropertyChanged, property being changed is: SelectedMediaItem
This is SelectedMediaItem's getter.
Calling SetProperty from SelectedMediaItem setter
Values are the same, property name is SelectedMediaItem, original value is The Mummy, new value is The Mummy
Done calling SetProperty
Done Invoking PropertyChanged
Done calling SetProperty

As you can see, in between the Lines “Invoking…” and “Done Invoking…”, SelectedMediaItem’s setter is called again.

Not sure what I can try to debug, but I definitely was not expecting the PropertyChanged event to call the property’s setter. Is that normal behaviour or am I just doing something wrong. Or am I completely misunderstanding this and totally wrong about everything haha.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật