WinUI 3 Issues

CPP 1 Reputation point
2021-08-25T11:35:46.84+00:00

I was exploring options to port our existing WPF app to the new WinUI 3. But it seems almost impossible. Even the most basic things are not working as intended, or am I doing something wrong?

1) A Canvas inside a ScrollViewer does not enable any scrollbars when Canvas children are out of bounds. I am adding several children to below canvas programatically but scrollbars don't show.

<ScrollViewer>
        <Canvas x:Name="MainCanvas" Background="AliceBlue"/>
</ScrollViewer>

2) A TabView does not stretch. Below, you have to set Height explicitly for the Grid for it to show, else it is not rendered.

<TabView>
        <TabView.TabItems>
            <TabViewItem Header="New Tab">
                <Grid Background="Magenta"/>
            </TabViewItem>
        </TabView.TabItems>
    </TabView>

3) There is no support for DrawingVisual (Media) classes. Is there a substitute for simple lightweight drawings on Canvas other than the Shapes library?

Thanks

Universal Windows Platform (UWP)
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
747 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 32,721 Reputation points Microsoft Vendor
    2021-08-26T02:59:15.04+00:00

    Hello,

    Welcome to Microsoft Q&A!

    First of all, please ask one question in one thread next time. This makes the thread more clear and we could focus on one question at a time.

    A Canvas inside a ScrollViewer does not enable any scrollbars when Canvas children are out of bounds. I am adding several children to below canvas programatically but scrollbars don't show.

    Please set a size for the Canvas so the ScrollViewer could know how big it is. You mentioned you've added several children to the canvas, then please set the width and height for the Canvas as well. Also, please set the HorizontalScrollBarVisibility property of the ScrollViewer as Auto.

    A TabView does not stretch. Below, you have to set Height explicitly for the Grid for it to show, else it is not rendered.

    This is expected. Even in a UWP app, you have to set the height and width to make the Grid shown in the TabView Item. WinUI used to be a library of controls that provides official native Microsoft UI controls and features for Windows UWP apps. WinUI 3 is the next generation of the WinUI framework. So WinUI3 has similar behavior to UWP controls.

    There is no support for DrawingVisual (Media) classes. Is there a substitute for simple lightweight drawings on Canvas other than the Shapes library?

    Currently, no. You could submit a feature request here: WinUI3 issues.

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments