How to use Buttons/Textboxes without ThemeChanges?

We do have a MIP-Plugin which uses Buttons and Textboxes. The Button Foregroundcolor and Textbox Backgroundcolor cant be changed. Except if your changing the theme.

I found mipsdk-samples-plugin-main/SCTheme as an Milestone example for WPF Elements that wont be changed by any theme changes. But the example just works for Textblocks. If i try the same as the example has with Textbox or Buttons it still get changed by theme changes.

Does anyone know how to do the SCTheme example with Buttons/Textboxes?

Thanks for your help.

Theme changes works by doing a different style. If you for your button and text box create your own style the Smart Client theme change shouldn’t overwrite it.

i do have an own style. It still overwrites it. But still thanks for the answer.

You are right that it wasn’t that simple. I have had to consult a Milestone Developer. Here is a XAML snippet that works and does not get overwritten by the theming.

<Button>
	<Button.ContentTemplate>
		<DataTemplate>
			<TextBlock Foreground="Yellow" Text="Button text"/>
		</DataTemplate>
	</Button.ContentTemplate>
</Button>

Note that we recommend to use “XProtect Design System user controls” as mentioned here..

https://doc.developer.milestonesys.com/html/index.html?base=reference/architecture/user_controls.html&tree=tree_1.html

https://productexperience.milestonesys.com/

These are themed. They are recommended as it makes it easy to get a design that is very close to that of the Smart Client itself. You might not want this, but instead follow your own design style, but I thought I should mention it.

Thanks for the Answer.

Helped alot. Its a little different for Textboxes but nearly the same.

If someone wants to use it with Textboxes: use a ControlTemplate instead of a ContentTemplate.