Cancelling SplitView Close Event without Stopping Mouse Events

33 Views Asked by At

I'm working on a WinUI 3 app, and I'd like to have my SplitView.Pane permanently open. I used this StackOverflow answer to try and solve the problem, however doing

private void SplitView_PaneClosing(SplitView sender, SplitViewPaneClosingEventArgs args)
{
    args.Cancel = true;
}

will stop all mouse events to children elements of the SplitView.

My question is whether there is a different way to keep the SplitView from closing its pane, or maybe another component to give me the same look as the SplitView without the pane being able to be closed.

1

There are 1 best solutions below

2
Andrew KeepCoding On BEST ANSWER

Besides setting IsPaneOpen to True, try setting DisplayMode to Inline.

<SplitView
    DisplayMode="Inline"
    IsPaneOpen="True">
    <SplitView.Pane>
        <TextBlock Text="Pane" />
    </SplitView.Pane>
    <TextBlock Text="Content" />
</SplitView>