Tool windows are a very similar approach; however, they are
a little different. Tool windows can be featured in different areas of the
applications. Tool windows can be in the left, right, and bottom sides of the
screen. This is handled through the tool window collection constructor, using
an enumeration that specifies the location that the collection represents:
Listing 6
public ToolWindowCollection(ToolWindow.LocationType location)
{
_location = location;
}
Because a tool window is in a specific region, the tool
window has to be in an area defined by the location type. Is it possible through
this approach, to move the location? For each property, there is a detection
of that property change. For instance, in the Title property of the UIElement
class, is the following in the setter:
Listing 7
if (string.Compare(_title, valueCheck, StringComparison.CurrentCulture) != 0)
{
string oldValue = _title;
_title = value;
this.OnPropertyChanged(new PropertyChangedEventArgs("Title", oldValue, value));
}
This statement broadcasts a property change whenever the
value changes or the title changes. This works for all the properties, and is
similar to the property change notification for certain windows components.
This can also work to change the location of a toolbar (say from left to right,
in response to dragging the window).