private void DeleteUnit_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; HostingUnit unit = (HostingUnit)button.DataContext; bl.DisableHoustingUnit(unit.Key); lstUnits = bl.GetHostingUnitsByHostId(unit.HostId).ToList(); lstUnits.RemoveAll(x => x.Status == ActivityStatus.INACTIVE); this.UnitsViewList.ItemsSource = lstUnits; this.UnitsViewList.Items.Refresh(); }