locked
How can I connect the public properties within this code to a control within Expression Blend 4? RRS feed

  • Question

  • What do I need to do to bind the public properties from this code to a control within Expression Blend 4? 
    Public Class winLookup
    
      Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnClose.Click
        End
      End Sub
    
      Private Sub winLookup_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        Dim ds As New System.Data.DataSet("CustomerProperties")
    
        GetData(ds)
    
      End Sub
    
      Private Sub GetData(ByRef i_ds As System.Data.DataSet)
    
        Dim Customers As New List(Of CustomerProperties)
    
        Dim conn As New MySqlConnection()
        Dim connString As String = "Database=Customers; Data Source=localhost; User Id=root; Password=??????"
        conn.ConnectionString = connString
    
        Try
          conn.Open()
        Catch ex As Exception
          lblBuild.Content = ex.ToString()
        End Try
    
        Dim sqlcmd As New MySqlCommand("SELECT * FROM tblcustomers", conn)
        Dim da As New MySqlDataAdapter(sqlcmd)
        da.Fill(i_ds)
    
        conn.Close()
    
        'Dim da As New dataSet_CustomersTableAdapters.DataTableTableAdapter()
        'Dim dt As dataSet_Customers.DataTableDataTable = da.GetData()
      End Sub
    End Class
    
    '[DataContract]
    
    Public Class CustomerProperties
      Private _ID As Integer
      Private _OldID As Integer
      Private _LastName As String
      Private _FirstName As String
      Private _Initial As String
      Private _DOB As DateTime
      Private _SSN As String
      Private _Race As Int16
      Private _Sex As Char
      Private _IdentNumber As String
      Private _IdentType As Integer
      Private _IdentExpires As DateTime
      Private _IdentAuthority As String
      Private _Address1 As String
      Private _Address2 As String
      Private _City As String
      Private _State As String
      Private _Zip As String
      Private _HomePhone As String
      Private _WorkPhone As String
      Private _TotalPawns As Integer
      Private _PawnsForfeited As Integer
      Private _PawnsRedeemed As Integer
      Private _PawnsOpen As Integer
      Private _HeightFeet As Int16
      Private _HeightInches As Int16
      Private _Weight As Int16
      Private _HairColor As String
      Private _EyeColor As String
      Private _Updated As DateTime
      Private _UpdatedBy As String
      Private _UpdatedWS As String
      Private _IsActive As Boolean
      Private _Employer As String
      Private _Tatoos As String
    
    
      Public Property ID() As Integer
        Get
          Return _ID
        End Get
    
        Set(ByVal value As Integer)
          _ID = value
        End Set
      End Property
    
      Public Property OldID() As Integer
        Get
          Return _OldID
        End Get
    
        Set(ByVal value As Integer)
          _OldID = value
        End Set
      End Property
    
      Public Property LastName() As String
        Get
          Return _LastName
        End Get
    
        Set(ByVal value As String)
          _LastName = value
        End Set
      End Property
    
      Public Property FirstName() As String
        Get
          Return _FirstName
        End Get
    
        Set(ByVal value As String)
          _FirstName = value
        End Set
      End Property
    
      Public Property Initial() As String
        Get
          Return _Initial
        End Get
    
        Set(ByVal value As String)
          _Initial = value
        End Set
      End Property
    
      Public Property DOB() As DateTime
        Get
          Return _DOB
        End Get
    
        Set(ByVal value As DateTime)
          _DOB = value
        End Set
      End Property
    
      Public Property SSN() As String
        Get
          Return _SSN
        End Get
    
        Set(ByVal value As String)
          _SSN = value
        End Set
      End Property
    
      Public Property Race() As Int16
        Get
          Return _Race
        End Get
    
        Set(ByVal value As Int16)
          _Race = value
        End Set
      End Property
    
      Public Property ____() As Char
        Get
          Return _Sex
        End Get
    
        Set(ByVal value As Char)
          _Sex = value
        End Set
      End Property
    
      Public Property IdentNumber() As String
        Get
          Return _IdentNumber
        End Get
    
        Set(ByVal value As String)
          _IdentNumber = value
        End Set
      End Property
    
      Public Property IdentType() As Integer
        Get
          Return _IdentType
        End Get
    
        Set(ByVal value As Integer)
          _IdentType = value
        End Set
      End Property
    
      Public Property IdentExpires() As DateTime
        Get
          Return _IdentExpires
        End Get
    
        Set(ByVal value As DateTime)
          _IdentExpires = value
        End Set
      End Property
    
      Public Property Address1() As String
        Get
          Return _Address1
        End Get
    
        Set(ByVal value As String)
          _Address1 = value
        End Set
      End Property
    
      Public Property Address2() As String
        Get
          Return _Address2
        End Get
    
        Set(ByVal value As String)
          _Address2 = value
        End Set
      End Property
    
      Public Property City() As String
        Get
          Return _City
        End Get
    
        Set(ByVal value As String)
          _City = value
        End Set
      End Property
    
      Public Property State() As String
        Get
          Return _State
        End Get
    
        Set(ByVal value As String)
          _State = value
        End Set
      End Property
    
      Public Property Zip() As String
        Get
          Return _Zip
        End Get
    
        Set(ByVal value As String)
          _Zip = value
        End Set
      End Property
    
      Public Property HomePhone() As String
        Get
          Return _HomePhone
        End Get
    
        Set(ByVal value As String)
          _HomePhone = value
        End Set
      End Property
    
      Public Property WorkPhone() As String
        Get
          Return _WorkPhone
        End Get
    
        Set(ByVal value As String)
          _WorkPhone = value
        End Set
      End Property
    
      Public Property TotalPawns() As Integer
        Get
          Return _TotalPawns
        End Get
    
        Set(ByVal value As Integer)
          _TotalPawns = value
        End Set
      End Property
    
      Public Property PawnsForfeited() As Integer
        Get
          Return _PawnsForfeited
        End Get
    
        Set(ByVal value As Integer)
          _PawnsForfeited = value
        End Set
      End Property
    
      Public Property PawnsRedeemed() As Integer
        Get
          Return _PawnsRedeemed
        End Get
    
        Set(ByVal value As Integer)
          _PawnsRedeemed = value
        End Set
      End Property
    
      Public Property PawnsOpen() As Integer
        Get
          Return _PawnsOpen
        End Get
    
        Set(ByVal value As Integer)
          _PawnsOpen = value
        End Set
      End Property
    
      Public Property HeightFeet() As Int16
        Get
          Return _HeightFeet
        End Get
    
        Set(ByVal value As Int16)
          _HeightFeet = value
        End Set
      End Property
    
      Public Property HeightInches() As Int16
        Get
          Return _HeightInches
        End Get
    
        Set(ByVal value As Int16)
          _HeightInches = value
        End Set
      End Property
    
      Public Property Weight() As Int16
        Get
          Return _Weight
        End Get
    
        Set(ByVal value As Int16)
          _Weight = value
        End Set
      End Property
    
      Public Property HairColor() As String
        Get
          Return _HairColor
        End Get
    
        Set(ByVal value As String)
          _HairColor = value
        End Set
      End Property
    
      Public Property EyeColor() As String
        Get
          Return _EyeColor
        End Get
    
        Set(ByVal value As String)
          _EyeColor = value
        End Set
      End Property
    
      Public Property Updated() As DateTime
        Get
          Return _Updated
        End Get
    
        Set(ByVal value As DateTime)
          _Updated = value
        End Set
      End Property
    
      Public Property UpdatedBy() As String
        Get
          Return _UpdatedBy
        End Get
    
        Set(ByVal value As String)
          _UpdatedBy = value
        End Set
      End Property
    
      Public Property UpdatedWS() As String
        Get
          Return _UpdatedWS
        End Get
    
        Set(ByVal value As String)
          _UpdatedWS = value
        End Set
      End Property
    
      Public Property IsActive() As Boolean
        Get
          Return _IsActive
        End Get
    
        Set(ByVal value As Boolean)
          _IsActive = value
        End Set
      End Property
    
      Public Property Employer() As String
        Get
          Return _Employer
        End Get
    
        Set(ByVal value As String)
          _Employer = value
        End Set
      End Property
    
      Public Property Tatoos() As String
        Get
          Return _Tatoos
        End Get
    
        Set(ByVal value As String)
          _Tatoos = value
        End Set
      End Property
    End Class
    
    
    

    Tuesday, November 2, 2010 6:08 PM

All replies

  • You will need to either set the datacontext of a control and use databinding, or directly set the itemssource of something.

     

    If you provide more detail about what you are trying to do we can post a more complete answer.

    Tuesday, November 2, 2010 6:25 PM
    Moderator
  • The data will be bound to a PathListBox through which I will implement a carousel effect. There will be a textbox that will trigger sorting of the dataset as the user keys in data.
    Tuesday, November 2, 2010 6:44 PM