Skip to main content

Microsoft Silverlight

Answered Question Property is null just the first timeRSS Feed

(0)

Agnushallard
Agnushal...

Member

Member

54 points

140 Posts

Property is null just the first time

How I test if the property is empty or null If  the first time I used the property it is always empty or null

  

    Public Sub New()
        InitializeComponent()

        objnumero.NOME = ""

        gridvalida.DataContext = objnumero
    End Sub

        Private privateNOME As String
        Public Property
NOME() As String
            Get
                Return
privateNOME
            End Get
            Set
(ByVal value As String)
                If String.IsNullOrEmpty(value) Then
                    Throw New
Exception("Obrigatório")
                End If
                privateNOME = value
                NotifyPropertyChanged("NOME")
            End Set
        End Property

 
 

Using

Visual Studio 2008
Silverlight 3
WCF
MySQL

DJanjicek
DJanjicek

Participant

Participant

970 points

324 Posts

Answered Question

Re: Property is null just the first time

If (Not String.IsNullOrEmpty(objnumero))
     gridvalida.DataContext = objnumero
End If


Something like that?

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities