Customize style of the button area inside the UserPromptControl

Fundamentals for Avalonia Forum

Posted 3 months ago by Fabian Schipp
Avatar
Environment

I am using version 24.2.0 of the ActiproSoftware.Controls.Avalonia.Pro package with Avalonia version 11.2.0

Question

I am trying to change the style of the divider that is shown at the top of the button area inside the UserPromptControl. Is this possible in any way?

The only way I could imagine is the `Theme` property on the control. However I don't know which element to select and I also cannot access the prompt in the Avalonia DevTools.

Any help would be appreciated.

Comments (5)

Posted 3 months ago by Fabian Schipp
Avatar

I got the Avalonia DevTools working on the prompt with this:

.AfterInitializeWindow(window => window.AttachDevTools())

And I see the Border I would like to edit. However to style this I probably need to create a custom theme which needs to base on the ControlTheme used by ActiPro to style the UserPromptControl. This however is unknown to me. Is there any source where I can find that name?

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

Hi Fabian,

If you have a Pro license, you can download the full source of all our templates after logging into your organization's account on our website.

For that specific Border, there is not an easy way to target it with a style since it is unnamed.  The Background is based on the UserPromptControl.TrayBackground property, BorderBrush is based on the UserPromptControl.BorderBrush property, BorderThickness is fixed at 1px for the top border.

The ControlTheme applied to UserPromptControl is implicit based on the control type so you'd just need to base any custom theme on {StaticResource {x:Type actipro:UserPromptControl}}.

As a word of caution, the next release of our Avalonia controls (releasing very soon) is updating how the status/footer icons are defined. There are some properties being renamed and the template for displaying the icons is changing.  If you customize the template, make sure you look for changes in the next release and apply those to your template as well.

Would you mind sharing what you are hoping to change? Depending on how widely applicable the change is, we might be able to accomodate the change for the next release.


Actipro Software Support

Posted 3 months ago by Fabian Schipp
Avatar

Hi,

thanks for the quick reply.

My hope would be to have more control over the style of the dialog itself (borders, backgrounds, etc...). If that could be provided that would be great.

I will try out the proposed solution for now and get back to you.

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

For any fundamental changes in the layout of the control, that would require defining a new template.  For the existing layout, we have properties on UserPromptControl to alter most the colors.

Perhaps the best path forward for you is to copy our existing template and then tweak it to meet your specific needs.  If you do that, I suggest you wait until v25.1 is released since the template was updated to support changes in how icons are presented.


Actipro Software Support

Posted 3 months ago by Fabian Schipp
Avatar

That's what I was planning to do. Alright, thanks for the heads up regarding v25.1. I'll wait for that.

Add Comment

Please log in to a validated account to post comments.