I have been playing with custom palettes and seeing what would work with my next hairbrained idea. When I add a winform user control to a palette everything looks as expected, when adding a wpf user control the background is all black. The buttons or whatever I add look fine it's just the background. Here is the code I am using:
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Windows;
[assembly:CommandClass(typeof(Tims_CSharp.CustomPalette))]
namespace Tims_CSharp
{
class CustomPalette
{
public PaletteSet myPaletteSet;
public PaletteControl controlPalette;
public wpfPalControl wpfPalette;
[CommandMethod("palSet")]
public void SamplePalette()
{
if (myPaletteSet == null)
{
myPaletteSet = new PaletteSet("MyPalette", new System.Guid("ABF3806E-DA13-4827-80FB-29D3F10952BE"));
controlPalette = new PaletteControl();
wpfPalette = new wpfPalControl();
myPaletteSet.Add("Custom Palette", controlPalette);
myPaletteSet.AddVisual("WPF Palette", wpfPalette);
}
myPaletteSet.Visible = true;
}
}
}
I am using vs2010 and AutoCAD 2012.
Any ideas why this is happening?
Thanks again,
Tim