Imports Microsoft.VisualBasic
Imports System
Imports DevExpress.ExpressApp.Win.Editors
Imports DevExpress.ExpressApp.Model
Imports DevExpress.ExpressApp.Editors

<PropertyEditor(GetType([String]), False)> _
Public Class SpreadPropertyEditor
    Inherits WinPropertyEditor
    Public Sub New(ByVal objectType As Type, ByVal info As IModelMemberViewItem)
        MyBase.New(objectType, info)
        ControlBindingProperty = "SpreadInfo"
    End Sub
    Private SpreadUserControlCore As SpreadUserControl = Nothing
    Public ReadOnly Property SpreadUserControl() As SpreadUserControl
        Get
            Return SpreadUserControlCore
        End Get
    End Property
    Protected Overrides Function CreateControlCore() As Object
        SpreadUserControlCore = New SpreadUserControl()
        AddHandler SpreadUserControlCore.SpreadsheetControl1.CellValueChanged, AddressOf SpreadSheetControl_CellValueChanged
        Return SpreadUserControlCore
    End Function
    Protected Overrides Sub OnAllowEditChanged()
        MyBase.OnAllowEditChanged()

    End Sub
    Private Sub SpreadSheetControl_CellValueChanged(sender As Object, e As DevExpress.XtraSpreadsheet.SpreadsheetCellEventArgs)
        OnControlValueChanged()
    End Sub
End Class
