SOLIDWORKS Property Manager Page data changed events handling

Edit ArticleEdit Article

SwEx framework provides event handlers for the data changes in the controls. Use this handlers to update preview or any other state which depends on the values in the controls.

Post data changed event

PropertyManagerPageHandlerEx::DataChanged event is raised after the user changed the value in the control which has updated the data model. Refer the bound data model for new values.

public class DataModel
{
    public string Text { get; set; }
}

private DataModel m_Data;

private PropertyManagerPageEx<MyPMPageHandler, DataModel> m_Page;

public override bool OnConnect()
{
    m_Data = new DataModel();
    m_Page = new PropertyManagerPageEx<MyPMPageHandler, DataModel>(App);

    m_Page.Handler.DataChanged += OnDataChanged;

    return true;
}

private void OnDataChanged()
{
    var text = m_Data.Text;
    //TODO: handle the data changing, e.g. update preview
}

Product of Xarial Product of Xarial