Additional suggestions besides what Alexander has said:
1. Do not create a "raw" PaletteSet in the CommandClass/IExtensionApplication. Always subclass the PaletteSet for your own custom PaletteSet, wrap the code for creating itself inside and expose features required for business operation as properties/methods.
2. Unless you use very old AutoCAD (probably Acad2010 or older), there is no need to use System.Windows.Forms.Integration.ElementHost to add WPF UserControl to PaletteSet as Palette. WPF UserControl can be added as Palette with PaletteSet.AddVisual() method directly.
Something like:
public class MyPaletteSet : PaletteSet
{
private MyWpfControl _palette;
// Constructor
public MyPaletteSet(...) : base(...)
{
// set PaletteSet size/style/docking
... ...
// Add WFP Palette
_palette = new MyWpfControl();
AddVisual("[palette name]", _palette);
}
// you can expose the WFP control to outside as Property
public MyWpfControl CustomPalette => _palette;
// other properties/methods
... ...
}