3

According to the https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.splitview.paneclosed.aspx there is no PaneOpened event for the SplitView control, only PaneClosed event for the SplitView control that exists.

I have a Button control inside a SplitView pane that needs to change in size according whether the pane is opened or closed. So my plan is I will place a piece of code that will change the button size wider in the PaneOpened event, and restore it back to the small size in PaneClosed event. But it seems there is no PaneOpened event.

Any other way that I can achieve this?

Justin XL
  • 38,763
  • 7
  • 88
  • 133
Sangadji
  • 321
  • 5
  • 16

1 Answers1

9

Thanks to the new RegisterPropertyChangedCallback in UWP, you can now monitor property change events of any DependencyProperty, including native ones.

public SplitViewPage()
{
    this.InitializeComponent();

    this.splitView.RegisterPropertyChangedCallback(SplitView.IsPaneOpenProperty, IsPaneOpenPropertyChanged);
}

private void IsPaneOpenPropertyChanged(DependencyObject sender, DependencyProperty dp)
{
    // put your logic here
}
Justin XL
  • 38,763
  • 7
  • 88
  • 133