SelectedItem == null wpf c#

Пишу приложение,у меня имеется listbox в котором есть кнопка изменить,я по идее изменяю содержимое элемента,по нажатию на кнопку "изменить",открывается окно где я меяю значение соответствующий полей, и я просто удаляю предыдущий элемент и создаю новый с другими значениями,только вот у меня почему-то selecteditem = null???? теперь я не могу придумать как мне удалять элемент

public Advert _selectetListBoxItem;
        public Advert SelectetListBoxItem {
            get
            {
                return _selectetListBoxItem;
            }
            set
            {
                _selectetListBoxItem = value;
            }
        }
public ObservableCollection<Advert> ItemForListBox  { get; set;}
ItemForListBox = new ObservableCollection<Advert>();


ItemForListBox.Remove(SelectetListBoxItem);
ItemForListBox.Add(new Advert(ChangeDateOPublishedfadvertFromAddWindow, ChangeAuthorOfadvertFromAddWindow,
                                                ChangeContentOfadvertFromAddWindow, ChangeNameOfadvertFromAddWindow));
                                            db.SaveChanges();

view

  <WpfApp1:ContextHolder Margin="-112,0,10,0">
            <WpfApp1:ContextHolder.Commands >
                <WpfApp1:CommandBinding RoutedCommand="{x:Static ApplicationCommands.Delete}"
                                      RelayCommand="{Binding RemoveCommand}"/>
                <WpfApp1:CommandBinding RoutedCommand="{x:Static ApplicationCommands.Open}"
                                      RelayCommand="{Binding ShowContentCommand}"/>
                <WpfApp1:CommandBinding RoutedCommand="{x:Static ApplicationCommands.New}"
                                      RelayCommand="{Binding ChangeAdvertCommand}"/>
            </WpfApp1:ContextHolder.Commands>
            <ListBox SelectedIndex="{Binding SelectetListBoxIndex}" SelectedItem="{Binding SelectetListBoxItem}" ItemsSource="{Binding ItemForListBox}" HorizontalAlignment="Left" Height="394" Margin="30,10,0,0" VerticalAlignment="Top" Width="362">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel>
                                <TextBlock FontSize="16" Text="{Binding Path=NameOfAdvert}" HorizontalAlignment="Center" />
                                <TextBlock FontSize="16" Text="{Binding Path=DateOfPublished}" HorizontalAlignment="Center" />

                                <Button Margin="5"  Content="Читать" 
                                    Command="{x:Static ApplicationCommands.Open}"
                                    CommandParameter="{Binding}"/>
                                <Button Margin="5"  Content="Удалить" 
                                    Command="{x:Static ApplicationCommands.Delete}"
                                    CommandParameter="{Binding}"/>
                                <Button Margin="5"  Content="Изменить" 
                                Command="{x:Static ApplicationCommands.New}"
                                CommandParameter="{Binding}"/>
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </WpfApp1:ContextHolder>

Подскажите как решить введите сюда описание изображения

<wpfapp1:ContextHolder>
            <wpfapp1:ContextHolder.Commands >
                <wpfapp1:CommandBinding RoutedCommand="{x:Static ApplicationCommands.Print}"
                                      RelayCommand="{Binding FixedChangeCommand}"/>

            </wpfapp1:ContextHolder.Commands>
            <Button Content="Изменить" HorizontalAlignment="Left" Margin="21,257,0,0" VerticalAlignment="Top" Width="96"
                Command="{x:Static ApplicationCommands.Print}"
                                    CommandParameter="{Binding}"/>
        
    </wpfapp1:ContextHolder>
   

Ответы (0 шт):