public override void InitializeBackend(object frontend, ApplicationContext context)
{
base.InitializeBackend(frontend, context);
Menu = new SWF.MenuStrip();
ItemsCollection = Menu.Items;
_items.CollectionChanged += (sender, args) => {
var backend = args.NewItems.Cast <MenuItemBackend> ().FirstOrDefault();
if (args.Action == NotifyCollectionChangedAction.Add)
{
ItemsCollection.Insert(args.NewStartingIndex, backend.MenuItem);
}
if (args.Action == NotifyCollectionChangedAction.Remove)
{
ItemsCollection.Remove(backend.MenuItem);
}
};
}