Code from the control:
Public Sub SetVisibility(ByVal Page As String)
Dim SearchPersonPage As String = "SearchPerson.xaml"
Dim InputPersonPage As String = "EnterPerson.xaml"
If Page = InputPersonPage Then
btnAddAddress.Visibility = Windows.Visibility.Visible
cbxDefaultAddress.Visibility = Windows.Visibility.Visible
Else
btnAddAddress.Visibility = Windows.Visibility.Hidden
cbxDefaultAddress.Visibility = Windows.Visibility.Hidden
End If
End Sub
Code from the form calling the control:
Private Sub SearchPerson_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim page As New Address
Dim PageString As String = Parent.ToString
Dim k As String = Name.ToString
page.SetVisibility(PageString)
page.BeginInit()
rxpAddressInformation.UpdateLayout()
End Sub
|