Hey,
We have a common request from our customers to be able to hide Unpinned panels in a flyout mode by clicking on the "unpinned button" again or the header of the panel, without the need to wait to the panel to close automatically.
Is this possible and if yes how?
Thanks,
Mano
Hi,
I can suggest you to decrease the ultraDockManager1.AutoHideDelay in order to reduce the time of hiding the pane. Other option is to create a creation filter adding a button in the header of the FlyoutPane in whick Click event you can call FlyIn method of the pane:
class MyCreationFilter : Infragistics.Win.IUIElementCreationFilter
{
public bool BeforeCreateChildElements(Infragistics.Win.UIElement parent)
// return false so PositionChildElements will get called
// to do the default child element creation
return false;
}
public void AfterCreateChildElements(Infragistics.Win.UIElement parent)
PaneUIElement paneUIelement;
if (parent is PaneUIElement)
paneUIelement = (PaneUIElement)parent;
if (paneUIelement.Pane.Manager.FlyoutPane != null)
ButtonUIElement btn = new ButtonUIElement(parent);
//coordinates and size depends on your requirements
btn.Rect = new Rectangle(new Point(120, 0), new Size(30, 20));
btn.Text = "hide";
btn.ElementClick += new UIElementEventHandler(btn_ElementClick);
parent.ChildElements.Add(btn);
void btn_ElementClick(object sender, UIElementEventArgs e)
DockableWindow wind = (DockableWindow)sender;
if (wind.Pane.Manager.FlyoutPane != null)
wind.Pane.Manager.FlyIn();
You may submit a feature request for adding this option to the PaneDoubleClickAction enumeration at: http://devcenter.infragistics.com/protected/requestfeature.aspx
Regards,
Stefaniya
Let me know if this works for you or if you have any additional questions.
Thanks for the information.
The CreationFilter approach to add a new ButtonUIElement looks like a very good solution.
Now I'm trying to make the "FlyIn" Button looks like the other Pane Buttons and align it to the right side with the other Buttons.
I looked on the PaneCaptionButtonUIElement source code, but still not sure how to add this button.
Any idea how to do it?
The PaneCaptionButtonUIElement has ButtonType which is an enumeration including toggle and pushbutton types, so you would have to use the ButtonUIElement to create the button. You can style the ButtonUIElement according to your application look. The position of the button is specified by its rectangle coordinates and size. As the creation filter is called on each recreation of the control you would need to use static variables for the coordinates and the size, something like this:
PaneCaptionUIElement caption = (PaneCaptionUIElement)parent.GetDescendant(typeof(PaneCaptionUIElement));
List<UIElement> element=new List<UIElement>();
if (caption != null)
element = (from el in caption.ChildElements
where el is PaneCaptionButtonUIElement
orderby el.Rect.X ascending
select el).ToList();
if (element.Count != 0)
//the button
btn.Rect = new Rectangle(new Point(element[0].Rect.X - 17, element[0].Rect.Y), new Size(17, 17));
Thank you very much.