0

My app currently is a mix of WinUI and Win32 elements, that is, a top level window with a MenuBar at the top, and one Grid with 3 columns: One NavigationView at the left, another one at the right using the techniques discussed here and between them I put a normal Win32 HWND aimed to show the main interface of my real time audio/video/image editor drawn with Direct2D.

The idea is now to replace the middle HWND with a SwapchainPanel so I have a full WinUI interface.

This time the layout is as such:

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition ></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
    <NavigationView Grid.Column="0" Grid.Row="0" x:Name="LeftN"  .... >
    ...
    </NavigationView>
    <SwapChainPanel Grid.Column="1" Grid.Row="0" x:Name="scp" ></SwapChainPanel>
    <NavigationView  Grid.Column="2" Grid.Row="0" x:Name="RightN" ...>
    </NavigationView>
  1. My SwapChain panel isn't resizing when the left/right navs are opened or closed, it stays fixed.

enter image description here enter image description here

  1. My swapchain panel's height gets the maximum height of the nav that shows the more controls, it doesn't fully occupy the window. How do I tell it to take the entire height?

enter image description here

  1. The SwapChain drawing is much slower, compared to the Win32 native window. Is this a limitation of the current implementation?

Best & Thanks,

Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
  • SwapChainPanel should work fine. You can check it's integration and perf with WinUI3 in this (C#) sample here https://github.com/smourier/DirectN/tree/master/DirectN/DirectN.WinUI3.MinimalD3D11 and between navigation views with a Xaml like this: https://pastebin.com/raw/tph2S2Mu or please provide some reproducible code – Simon Mourier Jun 10 '23 at 08:19
  • Can you set HorizontalAlignment="Strech" and VerticalAlignment="Strech" on the SwapChainPanel ? – Martin Jun 20 '23 at 14:49

0 Answers0