amwx / FluentAvalonia

Control library focused on fluent design and bringing more WinUI controls into Avalonia
MIT License
1.05k stars 97 forks source link

How can we set content on CommandBarToggleButton #485

Closed Eugenenoble2005 closed 1 year ago

Eugenenoble2005 commented 1 year ago

It seems the CommandBarToggleButton can only have a text and icon content set by the label and iconSource property respectively. How can we set custom content using the Content property like we can on the ToggleButton Control. I would have just used the ToggleButton Control, but the CommandBar children requires a commandBarToggleButton instead of a normal ToggleButton.

timunie commented 1 year ago

override the ControlTemplate to your needs. See: https://github.com/amwx/FluentAvalonia/blob/759d12a67f623a15f44c18c10e0e7480a69aa8e1/src/FluentAvalonia/Styling/ControlThemes/FAControls/CommandBar/CommandBarButtonStyles.axaml#L68-L150

Eugenenoble2005 commented 1 year ago

Thanks Tim!