// Code converted from VB.NET to C# using Telerik
[CommandMethod("WPFP")]
public void ShowWPFPalette()
{
if (_ps == null) {
// Create the palette set
_ps
= new PaletteSet
("WPF Palette"); _ps
.Size = new Size
(400,
600); _ps.DockEnabled = (DockSides)Convert.ToInt32(DockSides.Left) + Convert.ToInt32(DockSides.Right) + Convert.ToInt32(DockSides.Top) + Convert.ToInt32(DockSides.Bottom);
// Create our first user control instance
UserControl1 uc
= new UserControl1
(); ElementHost host1
= new ElementHost
(); host1.AutoSize = true;
host1.Dock = DockStyle.Fill;
host1.Child = uc;
_ps.Add("Awesome Tab", host1);
// Create our second user control instance and
// host it in an ElementHost, which allows
// interop between WinForms and WPF
UserControl2 uc2
= new UserControl2
(); ElementHost host2
= new ElementHost
(); host2.AutoSize = true;
host2.Dock = DockStyle.Fill;
host2.Child = uc2;
_ps.Add("Developer Tab", host2);
}
// Display our palette set
_ps.KeepFocus = true;
_ps.Visible = true;
}