forked from lepoco/wpfui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the markup extension for the SymbolIcon and FontIcon class not …
…working at all.
- Loading branch information
Showing
2 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,11 @@ namespace Wpf.Ui.Markup; | |
[MarkupExtensionReturnType(typeof(SymbolIcon))] | ||
public class SymbolIconExtension : MarkupExtension | ||
{ | ||
Check warning on line 34 in src/Wpf.Ui/Markup/SymbolIconExtension.cs GitHub Actions / build
|
||
|
||
public SymbolIconExtension() | ||
{ | ||
} | ||
|
||
public SymbolIconExtension(SymbolRegular symbol) | ||
{ | ||
Symbol = symbol; | ||
|
@@ -58,7 +63,12 @@ public SymbolIconExtension(SymbolRegular symbol, bool filled) | |
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
var symbolIcon = new SymbolIcon { Symbol = Symbol, Filled = Filled }; | ||
if (serviceProvider.GetService(typeof(IProvideValueTarget)) is IProvideValueTarget { TargetObject: Setter }) | ||
{ | ||
return this; | ||
} | ||
|
||
SymbolIcon symbolIcon = new() { Symbol = Symbol, Filled = Filled }; | ||
|
||
if (FontSize > 0) | ||
{ | ||
|