How do you apply the Actipro theme to a flyout?

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 10 months ago by Magnus Lindhe
Avatar

Consider an app where the ModernTheme is included but is overridden by another theme. How would you apply the theme for a flyout from what has been included in ModernTheme? I have not found a sample of this. 

Comments (4)

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Magnus,

Flyouts themselves are not controls.  But the presenters used for them are.

If you wanted to include a ControlTheme for a specific control, like a MenuFlyoutPresenter, you could add a ControlTheme whose key is the control type, targets the same type, and is BasedOn one of our predefined ControlThemes.  Our "actipro:ControlTheme" markup extension helps find those.

For example:

<ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter"
  BasedOn="{actipro:ControlTheme MenuFlyoutPresenter}">


Actipro Software Support

Posted 10 months ago by Magnus Lindhe
Avatar

I see, I wasn't aware of the "actipro:ControlTheme" markup extension.

Can I do something like:

<Button Theme="{actipro:ControlTheme Button}" /> even though the default theme for the Button is tied to another theme than ModernTheme?

Answer - Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Yes, you can do that as long as the "kind" you indicate after actipro:ControlTheme is a valid member of our ControlThemeKind enumeration.  For instance we don't have a "Button" value there, but have things like "ButtonOutline", "ButtonSolid", etc.  VS Intellisense may offer the options when typing.


Actipro Software Support

Posted 10 months ago by Magnus Lindhe
Avatar

Got it! That's just what I was looking for. Thanks!

Add Comment

Please log in to a validated account to post comments.