Well this works .. too bad the examples don't talk about making the calling function static :tickedoff: :tickedoff:Code - C#: [Select]
Hi,
You can have a look to this recent message (https://forums.autodesk.com/t5/net/visual-studio-2017-c-net-wpf-within-autocad/m-p/8178142/highlight/true#M59884).
CommandMethod CAN BE either static or non-static.
You did not show all code of the class (CommandClass?) where the CommandMethod "Test" is in. However, based on error message showed in your original post, it seems the class has a constructor that requires input parameter.
I have had to resort to subclassing PaletteSet (https://forums.autodesk.com/t5/net/paletteset-and-palette-newbie-question/m-p/5525779#M43442) so I can expose functions that I need to make them behave as they should.
What functionality would you need beside Show/Hide? Everything else should be handled by the palette. I use MVVM so functionality is in the ViewModel.
In a paletteset you can activate a palette only by index ... if you don't know what that is (you can't really know that if your paletteset is created dynamically) then the best option is to activate the palette by name. I can do that now.
In a paletteset you can activate a palette only by index ... if you don't know what that is (you can't really know that if your paletteset is created dynamically) then the best option is to activate the palette by name. I can do that now.
A PaletteSet is an IEnumerable, you can get a Palette by Name.Code - C#: [Select]
paletteSet.Cast<Palette>.FirstOrDefault(p => p.Name == "My Palette")
Keith, I have to say, my first thought was, if it's transient, maybe it should be a form.
I still have some sizing issues though. The tabs don't show the first time it's called until, a)the palette is rolled up and expanded or b) the palette is resized larger that the minimum size.
And the palette does not adhere to minimum size when docked. It can be resized smaller than the minimum size.
Ah well … not using WPF controls
Ah well not using WPF controls
Now I see why you've had some of the issues you've had and the need to subclass.
WPF and the MVVM architecture is the only way to go in C# for desktop UI. Time to let the past go and move over.