Avatar of JoeBo747
JoeBo747
 asked on

Remove Item from class object

I have a Class which is declared as:

Imports System.ComponentModel

Public Class PendingDel
    Implements INotifyPropertyChanged
#Region "INotifyPropertyChanged Members"

    Public Event PropertyChanged As PropertyChangedEventHandler _
       Implements INotifyPropertyChanged.PropertyChanged

    Private Sub OnPropertyChanged(propertyName As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))

    End Sub

#End Region

Private m_JobNum As String
    Public Property JobNum As String
        Get
            Return m_JobNum
        End Get
        Set(value As String)
            If Me.m_JobNum <> value Then
                Me.m_JobNum = value
                Me.OnPropertyChanged("JobNum")
            End If
        End Set
    End Property

Private m_Driver As String
    Public Property Driver() As String
        Get
            Return Me.m_Driver
        End Get
        Set(value As String)
            If Me.m_Driver <> value Then
                Me.m_Driver = value
                Me.OnPropertyChanged("Driver")
            End If
        End Set
    End Property
End Class

I have declared a new collection at class level
Public Shared itemsSource As New ObservableCollection(Of Object)()

I am adding new items to the class using:
Public Sub loadDriverJobs()
        itemsSource.Add(New PendingDel() With { _
                             .JobNum = 1, _
                             .Driver = "Bob"})
        itemsSource.Add(New PendingDel() With { _
                             .JobNum = 2, _
                             .Driver = "Ian"})
    End Sub

How would I remove the JobNum 2 from the class, I have looked at different examples but can’t find how to achieve this, any help would be appreciated.
.NET Programming

Avatar of undefined
Last Comment
JoeBo747

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Aruiz04

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
JoeBo747

ASKER
Thanks for the reply, I was querying the itemsSource and attempting to remove the item via the returned records! Couldn’t spot the obvious!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck