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

Add support for showing Pro icons in Design Mode #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nj
Copy link

@nj nj commented May 12, 2024

When including Pro fonts in a local project, it'll fail to load the fonts due to Assembly.GetEntryAssembly() being WpfSurface in Design Mode - hence won't load the proper project asssemply resources, neither for IconBlock nor IconImage:
billede

It also triggers an Exception with Value cannot be null. (Parameter 'fontFamily') for IconBlock:
billede

Above example with code in the TestWpf-project:

<StackPanel Grid.Row="9" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
    <faPro:IconBlock IconFont="Solid" Icon="WifiExclamation" fa:Awesome.Flip="Horizontal" FontSize="32" ToolTip="Flipped horizontally" Width="142" />
    <faPro:IconImage IconFont="Solid" Icon="WifiExclamation" fa:Awesome.Flip="Vertical" ToolTip="Flipped vertically" />
</StackPanel>

The %LocalAppData%\Microsoft\VisualStudio\<version reference>\Designer\Cache\<internal project build path> includes the fonts path (with the tff-files), in addition to the project assemply as well.

However, the next issue in this regards is, that even though a InitializeWpf function exists, this is within an internal class - and not available. In addition, doesn't seems to make much of a change even by trying to start early.

That said, there might be a more proper solution, to handle this particular scenario - just was without luck when trying...

When including fonts in a local project, it'll fail to load the fonts due to  Assembly.GetEntryAssembly() being `WpfSurface` in Design Mode - hence won't load the proper project asssemply resources.
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

Successfully merging this pull request may close these issues.

None yet

1 participant