Forum Discussion
Jacob_Persson
Nov 08, 2021Copper Contributor
Example code for Maui Shell
I am using the transition from Xamarin forms to Maui as an excuse to start using Shell as well. Since Shell has been in the Maui previews for a long time now, I thought it would be easy to get st...
- Nov 08, 2021You can find one such sample for making use of Shell made available in the GitHub repository https://github.com/egvijayanand/dotnet-maui-samples
Juan Montoya
Mar 10, 2022Copper Contributor
I am using the sample and added an image to the flyout header:
<Shell.FlyoutHeader>
<Grid BackgroundColor="{DynamicResource WindowBackgroundColor}"
HeightRequest="150"
Padding="0, 10">
<Image Source="dotnet_bot.png"
HorizontalOptions="Center"
VerticalOptions="Center"
HeightRequest="130"
WidthRequest="180"/>
</Grid>
</Shell.FlyoutHeader>
It works in Android but the image does not display in Windows, what am I missing? The image is in the "resources\images\" folder dotnet_bot.svg ... as you know MAUI will generate the dotnet_bot.png, but in Windows it looks like the publish folder is different. What do I need to do, so it works in both platforms? Thanks in advance.
egvijayanand
Mar 10, 2022Copper Contributor
Juan Montoya Check for the presence of this attribute windows:Application.ImageDirectory="Assets" in the App.xaml file.
This has been deprecated in https://github.com/dotnet/maui/wiki/Migrating-to-Preview-13, hence needs to be removed.
The sample in GitHub is reflecting the change while it is updated for Preview 13.
- Juan MontoyaMar 16, 2022Copper Contributoryes! I removed it and now it is working. Thank you.