Public Class CurrentUser
Inherits CommonViewModelBase
Private Shared _name As String = "No Name"
Private Shared _ID As Integer
Private Shared _thisInstance As CurrentUser
Public Shared Property name As String
Get
Return _name
End Get
Set(value As String)
_name = value
_thisInstance.OnPropertyChanged(NameOf(name))
End Set
End Property
Public Shared Property ID As Integer
Get
Return _ID
End Get
Set(value As Integer)
_ID = value
_thisInstance.OnPropertyChanged(NameOf(ID))
End Set
End Property
Protected Sub New()
'initialization code goes here
End Sub
Public Shared Function GetCurrentUser() As CurrentUser
'
' initialize object if it hasn't already been done
'
If _thisInstance Is Nothing Then
_thisInstance = New CurrentUser
End If
'
' return the initialized instance
'
Return _thisInstance
End Function
End Class
Public Property localCurrentUser As CurrentUser = CurrentUser.GetCurrentUser
<StackPanel Orientation="Horizontal" Grid.Row="4" HorizontalAlignment="Right" DataContext="{Binding localCurrentUser}">
<TextBlock Name="StaffNameTextBlock1" Text="Staff Name (Click to Change) "/>
<TextBlock x:Name="StaffNameTextBlock" Text="{Binding name, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True}"/>
</StackPanel>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE