Hello,
I have a wpf class derived from System.Windows.Controls.Button
-- --- JButtonWPF.cs ---
using System.Windows; using System.Windows.Controls; namespace Jedox.Controls { public partial class JButtonWPF : Button { public JButtonWPF() { dynamic ds = TryFindResource(ToolBar.ButtonStyleKey); if (ds is Style) { this.Style = ds; } } } }
( This class has normally more code, but to create my Problem this is sufficient.)
Now I want to host an object of this type in one Windows.Form Dialog.
JButtonWPF Wpfb = new JButtonWPF(); this.btn_user.Child = Wpfb; this.btn_user.PropertyMap.Remove("BackColor"); this.btn_user.PropertyMap.Remove("BackgroundImage"); this.btn_user.PropertyMap.Remove("BackgroundImageLayout");
When I open the dialog I see a black square, but when I move the mouse over the the button I see a gray square.
When I comment out the line
this.Style = ds
in JButtonWPF.cs I see gray square which doesn't Change when I move the mouse over the button, but the button isn't flat anymore.
So how can I achieve that this button has a "flat" style, but doesn't change automagically the Background.
tia
Hendrik Schmieder