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

Fix not being able to use Icon markup extensions as the Value of a Setter #1159

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

Difegue
Copy link
Contributor

@Difegue Difegue commented Jul 12, 2024

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Trying to use {ui:SymbolIcon} or {ui:FontIcon} extensions as the Value of a Setter in a Style will fail:

<ui:Button>
<ui:Button.Style>
    <Style TargetType="ui:Button" BasedOn="{StaticResource {x:Type ui:Button}}">
        <!-- Flip icon on RTL language -->
        <Setter Property="Icon" Value="{ui:SymbolIcon ArrowLeft24}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:MainWindow}, Path=FlowDirection}" Value="{x:Static FlowDirection.RightToLeft}">
                <Setter Property="Icon" Value="{ui:SymbolIcon ArrowRight24}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
</ui:Button.Style>
</ui:Button>
SymbolIconExtension is not valid for Setter.Value. The only supported MarkupExtension types are DynamicResourceExtension and BindingBase or derived types.

Issue Number: N/A

What is the new behavior?

  • The extensions can be used in Setters again.

Other information

This change was brought in #1067 , but the incriminating lines don't seem to be related to the problem this PR was fixing (adding the missing constructor)

@Difegue Difegue requested a review from pomianowski as a code owner July 12, 2024 14:10
@github-actions github-actions bot added PR Pull request dotnet labels Jul 12, 2024
@m0lDaViA
Copy link
Contributor

@Difegue if i remember correctly this specific part was already in the class and got only moved but feel free to correct me.

@Difegue
Copy link
Contributor Author

Difegue commented Jul 17, 2024

I don't believe that to be the case looking at the diff of the original PR, unless I've missed something 🤔

@m0lDaViA
Copy link
Contributor

I don't believe that to be the case looking at the diff of the original PR, unless I've missed something 🤔

Hm ... looks like yeah. I could swear it was already in :s

@pomianowski
Copy link
Member

Hey @Difegue, thanks for the work you've put in

@pomianowski pomianowski merged commit 305ee57 into lepoco:development Jul 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet PR Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants