-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Windows] No application icon in the titlebar #23572
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Open similar issues:
Closed similar issues:
|
Ok, the bot is helpful. I found this comment #20265 (comment) and I can fix it using: <maui:MauiWinUIApplication
x:Class="MauiAppIcon202407.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:MauiAppIcon202407.WinUI">
<!-- <AddThis> -->
<maui:MauiWinUIApplication.Resources>
<DataTemplate x:Key="MauiAppTitleBarTemplate">
<Border Canvas.ZIndex="1" VerticalAlignment="Stretch" Margin="0,0,0,0">
<StackPanel Orientation="Horizontal" Margin="12, 0, 0, 0" x:Name="RootStackPanel">
<Image x:Name="AppFontIcon" HorizontalAlignment="Left" VerticalAlignment="Center" Source="appiconLogo.png" Visibility="Visible" Width="16" Height="16"/>
<TextBlock x:Name="AppTitle" VerticalAlignment="Center" Margin="{Binding WindowTitleMargin}" Text="{Binding WindowTitle}"
Foreground="{Binding WindowTitleForeground}" Style="{StaticResource CaptionTextBlockStyle}" />
</StackPanel>
</Border>
</DataTemplate>
</maui:MauiWinUIApplication.Resources>
<!-- </AddThis> -->
</maui:MauiWinUIApplication> |
The second workaround is to change: -<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
+<MauiImage Include="Resources\AppIcon\square44x44logo.png" /> |
Duplicate of #6908 |
Description
I created a new MAUI project and ran on Windows. I cannot see any application icon in my titlebar.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.70 SR7
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: