.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PaletteSet SizeChaned Event

1 REPLY 1
Reply
Message 1 of 2
yskific
422 Views, 1 Reply

PaletteSet SizeChaned Event

Hi there,

 

I am using this event to set the size of a hosted Wpf User Control. But when the palette is docked Left and AutorollUp set to False there is a title bar on the upper part of the paletteSet, it looks like that the height of that TitleBar is not deduced from the Palette size itself in the PaletteSetSizeEventArgs passed with that event. I tried to get the avaiable inside space of the paletteset from the paletteSet.paletteSize property, but it is the same size that is passed in the PaletteSetSizeEventArgs. In that case the inside space is over estimated and the bottom part of the user control can not be seen.

 

Is there something i am misssing, or is there a way to get the height of the TitleBar to deduce it ?

 

Yvan Skific

http://linea-trace.blogspot.com/

 

PS: I noticed another issue with the width, when the palette is docked Bottom

1 REPLY 1
Message 2 of 2
FRFR1426
in reply to: yskific

PaletteSet.PaletteSize property gives you the size of the client area of the palette set. So you can resize your WPF control this way:

 

static void paletteSet_SizeChanged(object sender, PaletteSetSizeEventArgs e)
{
  WpfCtrl.Width = e.Width;
  WpfCtrl.Height = e.Height;
  var ps = (PaletteSet) sender;
// ps.Size is the size of the palette set before resize. if (ps.DockEnabled == DockSides.Bottom || ps.DockEnabled == DockSides.Top) WpfCtrl.Width -= ps.Size.Width - ps.PaletteSize.Width; else if (ps.DockEnabled == DockSides.Left || ps.DockEnabled == DockSides.Right) WpfCtrl.Height -= ps.Size.Height - ps.PaletteSize.Height; }

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost