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

Question: Three different png images are references in xaml an code but does not exist in solution? #55

Open
tedekeroth opened this issue Jan 22, 2022 · 2 comments

Comments

@tedekeroth
Copy link

I see several references to .png images, in for example App.xaml:

<!-- Desktop/Tablet-->
<FlyoutItem Title="Home" Icon="tab_home.png">
    <ShellContent ContentTemplate="{DataTemplate page:HomePage}"/>
</FlyoutItem>
<FlyoutItem Title="Favorites" Icon="tab_favorites.png">
    <ShellContent ContentTemplate="{DataTemplate page:FavoritesPage}"/>
</FlyoutItem>
<FlyoutItem Title="Map" Icon="tab_map.png">
    <ShellContent ContentTemplate="{DataTemplate page:MapPage}"/>
</FlyoutItem>
<FlyoutItem Route="settings" Icon="tab_map.png" >
    <ShellContent ContentTemplate="{DataTemplate page:SettingsPage}"/>
</FlyoutItem>

<!-- Phone -->
<TabBar x:Name="PhoneTabs">
    <Tab Title="Hem" Icon="tab_home.png">
        <ShellContent ContentTemplate="{DataTemplate page:HomePage}"/>
    </Tab>
    <Tab Title="Favorites" Icon="tab_favorites.png">
        <ShellContent ContentTemplate="{DataTemplate page:FavoritesPage}"/>
    </Tab>
    <Tab Title="Map" Icon="tab_map.png">
        <ShellContent ContentTemplate="{DataTemplate page:MapPage}"/>
    </Tab>
    <Tab Title="Settings" Icon="tab_settings.png">
        <ShellContent ContentTemplate="{DataTemplate page:SettingsPage}"/>
    </Tab>
</TabBar>

But, when I try to find those image files in the solution, I can't find them - there are no tab_home.png, tab_favorites.png or tab_map.png. However, in Resources/Images I find the .svg versions:

  • Resources/Images/tab_home.svg
  • Resources/Images/tab_favorites.svg
  • Resources/Images/tab_map.svg

Also in the \src\WeatherTwentyOne\Converters\ActiveTabConverter.cs, the png files are references (as hardcoded strings).

So, what am I missing here? How can the application display the icons (cause they are displayed correctly) when the file names are wrong?

@gitgitwhat
Copy link

I just started experimenting with .NET MAUI and the Weather app and had the exact same question. Whatever the answer is, I hope they make resource management much easier to deal with. For example, how do you even import image files so that they are placed properly for all the different solutions to access them? It's not very clear to me as someone who is coming from mainly WinForms.

@VladislavAntonyuk
Copy link

Read about https://github.com/Redth/ResizetizerNT and its integration with .NET MAUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants