Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error CS1503: Argument 1: cannot convert from 'Microsoft.UI.Xaml.Controls.NavigationView' to 'Uno.Toolkit.UI.DrawerControl' #1055

Closed
IneedHelp opened this issue Feb 29, 2024 · 4 comments · Fixed by #1056
Assignees
Labels
control/drawer kind/bug Something isn't working

Comments

@IneedHelp
Copy link

On which page?

https://platform.uno/docs/articles/external/uno.toolkit.ui/doc/controls/DrawerControl.html#navigationview-with-drawer

What's wrong?

error CS1503: Argument 1: cannot convert from 'Microsoft.UI.Xaml.Controls.NavigationView' to 'Uno.Toolkit.UI.DrawerControl' when trying to compile that code

Any feedback?

removing utu:DrawerControlBehavior.FitToDrawerContent="False" makes the code compile fine

@IneedHelp IneedHelp added kind/contributor-experience Categorizes issue or PR as related to improving the experience of contributors kind/documentation Categorizes an issue or PR as relevant to 3rd party dependencies that are consumed by this project triage/untriaged Indicates an issue requires triaging or verification. labels Feb 29, 2024
@kazo0
Copy link
Contributor

kazo0 commented Feb 29, 2024

Hi @IneedHelp, thanks for the report!

Interesting, I will take a quick look with a sample app to see what the issue is.

And in your code you are setting Style the of the NavigationBar to DrawerNavigationViewStyle and you have properly initialized the ToolkitResources from the Getting Started?

I will test on my side and see if maybe we need to make some updates on this page, thanks!

@IneedHelp
Copy link
Author

IneedHelp commented Feb 29, 2024

Hello @kazo0 ,
I just used the sample code as it is in a fresh solution

<muxc:NavigationView PaneTitle="Gesture NavView"
                     OpenPaneLength="320"
                     utu:DrawerControlBehavior.FitToDrawerContent="False"
                     Style="{StaticResource DrawerNavigationViewStyle}">
    <muxc:NavigationView.MenuItems>
        <muxc:NavigationViewItem Content="Home"/>
        <muxc:NavigationViewItem Content="Page 1"/>
        <muxc:NavigationViewItem Content="Page 2"/>
        <muxc:NavigationViewItem Content="Page 3"/>
    </muxc:NavigationView.MenuItems>
    <muxc:NavigationView.Content>
        <Frame x:Name="contentFrame"/>
    </muxc:NavigationView.Content>
</muxc:NavigationView>

the style Style="{StaticResource DrawerNavigationViewStyle}" does influence the look, but whether it exists does not influence the compilation process.
Compilation fails because of utu:DrawerControlBehavior.FitToDrawerContent

and yes, I do have

<!-- Load Uno.Toolkit.UI resources -->
<ToolkitResources xmlns="using:Uno.Toolkit.UI" />

in the merged dictionaries.

@Xiaoy312 Xiaoy312 added kind/bug Something isn't working control/drawer and removed kind/contributor-experience Categorizes issue or PR as related to improving the experience of contributors kind/documentation Categorizes an issue or PR as relevant to 3rd party dependencies that are consumed by this project triage/untriaged Indicates an issue requires triaging or verification. labels Feb 29, 2024
@Xiaoy312 Xiaoy312 self-assigned this Feb 29, 2024
@kazo0
Copy link
Contributor

kazo0 commented Feb 29, 2024

Thanks @IneedHelp, nice catch! We will get this fixed as it is definitely an issue

@IneedHelp
Copy link
Author

Thanks @IneedHelp, nice catch! We will get this fixed as it is definitely an issue

@kazo0 Thank you for the prompt responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/drawer kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants