title: Xamarin Forms - how to generate an event based on Visible property changes
body: <p>In my application I have certain ContentViews that need to take an action when they become visible (namely load their data).  There are several events in the system that can cause them to become visible, so tying the load data operations to those is problematic as many of those events can occur one after the other.  If I had a way to simply load the data when the Visible property turns "true", then I will be in a much better place.</p>
  
  <p>I created a simple example of what I am trying to accomplish.  Namely I need the ContentView to generate an event when the Visible property changes.  It doesn't work, but I think it's close and I would appreciate someone showing me how to make it work.  If I can get this example to work, then I can wrap all of my ContentViews that need this functionality in a base ContentView that delivers the event I am needing.</p>
  
  <p>All the code can be found on GitHub <a href="https://github.com/JohnLivermore/PanelViewControl/tree/master" rel="nofollow noreferrer">here</a>.  If helpful, you can download the code to see the entire solution.  </p>
  
  <p>First I have a PanelView control defined.  Notice I am binding the IsVisible property to a PanelVisible property in the code behind...</p>
  
  <p><a href="https://i.stack.imgur.com/cLTlM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cLTlM.png" alt="enter image description here"></a></p>
  
  <p>Then in the code behind I have two BindableProperty props, PanelVisibleProperty and ShowingProperty.  PanelVisible is bound to IsVisible from above.  On the propertyChanged event, I am invoking the Showing Command.</p>
  
  <p><a href="https://i.stack.imgur.com/tPwOw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tPwOw.png" alt="enter image description here"></a></p>
  
  <p>In my MainPage.xaml I have a button which when clicked invokes the ShowPanelView Command which sets the PanelViewVisible property and makes the PanelView display (initially hidden upon load).  And, I bind the Showing Command from the PanelView to the PanelShowing Command in the model.</p>
  
  <p><a href="https://i.stack.imgur.com/Pswl3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pswl3.png" alt="enter image description here"></a></p>
  
  <p>And finally, here is the MainPageModel that is bound to the page...</p>
  
  <p><a href="https://i.stack.imgur.com/1bjb7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1bjb7.png" alt="enter image description here"></a></p>
  
  <p>I am not getting a propertyChanged event here, and if I can get that to happen, then I think the rest of it would work fine.</p>
  
  <p><a href="https://i.stack.imgur.com/FFtMa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FFtMa.png" alt="enter image description here"></a></p>
  
  <p>Can anyone see what the issue is?  Much thanks!</p>