I'm using the EditorSearchView inside of a ToolWIndow that I float when the the "Find" command is executed. I have no problem doing that. However, the EditorSearchView control can shrink and grow depending upon whether or not the search options are expanded or collapsed. I want the ToolWindow to expand/collpase automatically. With a normal window you can do that by setting the SizeToContent to WidthAndHeight. Here is how I'm defining the ToolWindow:
privatevoidCreateFindReplaceToolWindow(SyntaxEditor editor, bool find) {
var editorSearchview = newEditorSearchView();
ImageSource image;
if(find) {
image =
newBitmapImage(
newUri(@"pack://application:,,,/PLIDE;component/Images/Find.png", UriKind.RelativeOrAbsolute));
editorSearchview.
Mode = EditorSearchMode.Find;
}
else {
image =
newBitmapImage(
newUri(@"pack://application:,,,/PLIDE;component/Images/Replace.png", UriKind.RelativeOrAbsolute));
editorSearchview.
Mode = EditorSearchMode.Replace;
}
editorSearchview.
SyntaxEditor = editor;
var window = newToolWindow(DockingSite, "FindReplace", "Find/Replace", image, editorSearchview) {
CanAttach =
true,
CanAutoHide
=
true,
CanBecomeDocument
=
false,
CanDockLeft
=
true,
CanDockRight
=
true,
CanDockTop
=
false,
CanDockBottom
=
false,
CanRaft =
true,
CanMaximize
=
false
};
window.
Float(FloatSizingBehavior.SizeToContent);
}
The initial size of the window is correct, but when I expand the underlying control, the window does not resie as well. Anyway to make that happen?