The SplitView.PaneClosed event is available, but not for PaneOpened.

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

I have a Button control inside a SplitView panel, which should change depending on whether the panel is open or closed. So my plan is that I put a piece of code that will resize the button in the PaneOpened extension and return it to a small size in the PaneClosed event. But there seems to be no PaneOpened event.

Any other way I can achieve this?

+3
source share
1 answer

Thanks to the new RegisterPropertyChangedCallback in UWP, you can now track any property change events DependencyProperty, including your own.

public SplitViewPage()
{
    this.InitializeComponent();

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

private void IsPaneOpenPropertyChanged(DependencyObject sender, DependencyProperty dp)
{
    // put your logic here
}
+9
source

Source: https://habr.com/ru/post/1661363/


All Articles