Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.ExpressApp.SystemModule
Imports DevExpress.Persistent.Validation

Public Class DivideVAT_VC
    Inherits DevExpress.ExpressApp.ViewController

    Public Sub New()
        MyBase.New()


        InitializeComponent()
        RegisterActions(components)

    End Sub
    Protected Overrides Sub OnActivated()
        MyBase.OnActivated()
        If View.Id = "DivideVAT_DetailView" Then
            AddHandler Frame.GetController(Of DialogController)().AcceptAction.Executing, AddressOf DivideVAT_AcceptAction_Executing
        End If
    End Sub
    Protected Overrides Sub OnDeactivated()
        MyBase.OnDeactivated()
        If View.Id = "DivideVAT_DetailView" Then
            RemoveHandler Frame.GetController(Of DialogController)().AcceptAction.Executing, AddressOf DivideVAT_AcceptAction_Executing
        End If
    End Sub
    Sub DivideVAT_AcceptAction_Executing(sender As Object, e As System.ComponentModel.CancelEventArgs)
        Validator.RuleSet.ValidateAll(View.ObjectSpace, View.SelectedObjects, DefaultContexts.Save)
    End Sub
End Class
