I'm testing the RibbonBar addin feature, and want to try to alter an Area on the Save event.
I've written the following code:
//-----------------------------------------------------------------------
// <copyright file="czTestAddin.cs" company="Corbiz">
// All rights reserved ® Corbiz
// </copyright>
//-----------------------------------------------------------------------
namespace czTestAddin
{
using System;
using System.Text;
using Dynamicweb;
using Dynamicweb.Controls;
using Dynamicweb.Controls.Extensibility;
using Dynamicweb.Extensibility;
[AddInName("TestName")]
[AddInAuthor("Corbiz")]
[AddInDescription("TestDescription")]
[AddInTarget(RibbonBarAddInTarget.General.AreaEdit)]
public class czTestAddin : RibbonBarAddIn
{
public czTestAddin(RibbonBar ribbon) : base(ribbon)
{
this.Ribbon.DataContext.Save += new EventHandler<RibbonBarDataContextEventArgs>(DataContext_Save);
}
void DataContext_Save(object sender, RibbonBarDataContextEventArgs e)
{
//Alter Area and Save
}
public override void Load()
{
}
}
}
I can see in the documentation that it's only possible in the DataContext object extends DbObject, witch I can see the Area class does.
But the DataContext_Save function isn't called when I save.
Did i miss something i the documentation, or what is wrong?
Regards
KimS