The past couple days I have been making workspaces out of the Infragistics controls for CAB. As I’m developing against these new workspaces and refining them quite a bit. Kzu’s addition of the IComposableWorkspace interface has made making these workspaces much easier. So far I have just made an ExplorerBarWorkspace and a FlowLayoutWorkspace. After I get them refined I will post them out here so others can use them.
I’m also making a new command adapter for the UltraExplorerBarItem. For now I’m using the EventCommandAdapter but making one for the UltraExplorerBarItem will make life much easier. Any of you using the UltraExplorerBarItem probably have noticed that there is no “ItemClicked” event on it. This makes it a bit harder to use a command for when a particular item is clicked. So here is what I did to make this easier.
public class ExplorerItem : UltraExplorerBarItem
{
public event EventHandler<ItemEventArgs> ItemClicked;
public ExplorerItem()
: base()
{
}
public ExplorerItem(string key)
: base(key)
{
}
public ExplorerItem(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
protected override void OnAddedToCollection(KeyedSubObjectsCollectionBase primaryCollection)
{
base.OnAddedToCollection(primaryCollection);
this.ExplorerBar.ItemClick += new ItemClickEventHandler(ExplorerBar_ItemClick);
}
protected override void OnRemovedFromCollection(KeyedSubObjectsCollectionBase primaryCollection)
{
base.OnRemovedFromCollection(primaryCollection);
this.ExplorerBar.ItemClick -= new ItemClickEventHandler(ExplorerBar_ItemClick);
}
private void ExplorerBar_ItemClick(object sender, ItemEventArgs e)
{
if (e.Item == this && ItemClicked != null)
ItemClicked(this, e);
}
}
Now I just hook up a command to the ItemClicked event of the BarItem and eveything is good.
I will post more code probably next week when it is more nailed down.