lepoco / lepoco/wpfui

TitleBar Icon is missing

Open
#1,345 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

For me the Icon of the TitleBar is not shown when running the latest MVVM sample project.

I had to adjust the code from this:

<ui:TitleBar
            Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}"
            Grid.Row="0"
            Icon="pack://application:,,,/Assets/applicationIcon-256.png" />

To this:

<ui:TitleBar
            Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}"
            Grid.Row="0">
            <ui:TitleBar.Icon>
                <ui:ImageIcon>
                    <ui:ImageIcon.Source>
                        <BitmapImage UriSource="pack://application:,,,/Assets/applicationIcon-256.png" />
                    </ui:ImageIcon.Source>
                </ui:ImageIcon>
            </ui:TitleBar.Icon>
        </ui:TitleBar>

To make it work.

Does the samples need to be adjusted or am I doing something wrong?

Thanks in advance!

Regards,
Manuel

To Reproduce

Build and run the latest MVVM sample project.

Expected behavior

The window of the MVVM sample project displays the application icon in the title bar.

Screenshots

No response

OS version

Windows 10

.NET version

net8.0-windows

WPF-UI NuGet version

4.0.0

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Build and run the latest MVVM sample project on Windows, then inspect the sample's TitleBar declaration and the TitleBar icon handling. Compare the direct Icon markup with the nested ImageIcon form shown in the report. Done means the MVVM sample displays its application icon in the title bar without requiring the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.