arklumpus / AvaloniaColorPicker

A color picker for Avalonia
GNU Lesser General Public License v3.0
81 stars 6 forks source link

Changing the dialogs texts #14

Open robbelroot opened 1 year ago

robbelroot commented 1 year ago

When using like "new ColorPickerWindow" I couldn't find an easy method to change the text of the 2 buttons (cancel and submit). As my primary audience isn't english - I need to show translated values. Is there an easy way?

arklumpus commented 1 year ago

Hi, the best way to do this is to create a new Window implementing the IColorPickerWindow interface. In your window you can then change the text of the buttons (or even add or remove elements as you wish). The wiki has a page about this: https://github.com/arklumpus/AvaloniaColorPicker/wiki/Customising-the-colour-picker-window . You can start by just copying and pasting the code there, it should be trivial to change things like the text for the buttons [I have not yet updated that page for Avalonia 11, but the changes should be minimal].

You can then show your window by either creating it it using its constructor, or by using a ColorButton<T> instead of a regular ColorButton (again, see the wiki page).

I hope this makes sense, let me know if you need more help!