Hi,
I am making a ToolBar menu UserControl for my project. The ToolBar will have
n quantities of buttons based on each situation it undergoes. So for example in certain windows toolbar will have new, edit, delete buttons, but in other it might have upload, download, and print. This is a simple example, it gets more complicated than that.
Here is what i have so far:
In the UserControl (ToolBar)
Public Event btnNew_Click As btnNew_ClickedEventHandler
Public Delegate Sub btnNew_ClickedEventHandler(sender As Object)
Private Sub btnNew_MouseUp(sender As Object, e As MouseButtonEventArgs)
RaiseEvent btnNew_Click(Me)
End Sub
This code will make this event visible from the Window in xaml
<toolbar btnNew_Click="Code_for_New_Record"/>
So far so good (everything works). But I want to check if my Event is Attached from the MainWindow and if it is not, to hide it.
So for example, if i had buttons for update, delete, print, etc. And the programer for the MainWindow only coded the New Button, only the new Button should show.
Question:
How can I tell if the Event is attached or called? I would like to have some code that says
IF myEvent IsNot attached then
button.visibility = collapsed
end if
Thanks for all your help in advance!