Coder Social home page Coder Social logo

Comments (7)

davidxuang avatar davidxuang commented on July 22, 2024 1

I'm closing this as relevant changes have been revoked now. Feel free to reopen if there are more problems.

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

Hi,

This change is because that this class never implements border-related properties of TemplatedControl (which is the base class of IconElement), and BorderRenderHelper from Avalonia is only visible internally. And the initial reason for this is to be aligned with other XAML frameworks.

Since Avalonia now features PathIcon as the first official implementation of IconElement, do you think it's better to implement border-related properties instead?

from fluenticons.

StefanKoell avatar StefanKoell commented on July 22, 2024

To be honest, I'm not sure what would be the better approach. It's just that I used IconElement for a lot of things and this update broke almost all my references in various view models. It's an easy fix to change all to Control but I thought it was nice to have the common base class IconElement to have a bit of a constraint (and semantic hint) what's to expect. For a minor version update I thought it was quite a breaking change.

I've seen that the Fluent Avalonia variant (derived from FAIconElement) is still using the IconElement inheritance chain. Really not sure what's the better apprach.

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

I've just revoked the base class change and implemented Background, BorderBrush, BorderThickness, CornerRadius and Padding by hosting a Border instance. Still, there is a sematic problem that this TemplatedControl is not actually implemented by a ControlTemplate.

from fluenticons.

StefanKoell avatar StefanKoell commented on July 22, 2024

Hmm, since you do the rendering directly in code, there's no need for a template, right? I'm also not completely sure if that's just a cosmetic issue or if has other implications.

from fluenticons.

davidxuang avatar davidxuang commented on July 22, 2024

Never tried this but Template is exposed as a property, which seems weird for icon controls. I'm wondering why Avalonia chose so.

from fluenticons.

maxkatz6 avatar maxkatz6 commented on July 22, 2024

Because in Avalonia these are templated controls, which do not render themselves.
From PathIcon code: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Controls/PathIcon.xaml#L17-L25

from fluenticons.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.