Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cancelling SplitView Close Event without Stopping Mouse Events

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading