title: How to call VieModel function on custom binding Knockout Js
body: <p>How can I call a ViewModel function inside of a custom binding? I have a custom binding to apply jQuery Validate to a form and I need to call a function in the submitHandler, but nothing I've tried so far works. Can someone point me in the right direction? I've read the documentation, but it's not very clear on the subject.</p>
  
  <p>Here is my custom knockout binding</p>
  
  <pre><code>// activate the jQuery Validate on the form
   ko.bindingHandlers.validateEmailForm = {
      update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {      
          $(element).validate({
              errorLabelContainer: $("#updateEmailFormAlert"),
              wrapper: 'li',
              rules: {
                  email: {
                      required: {
                          depends: function(element) {
                              return $("#emailConfirm").is(":filled");
                          }
                      },
                      email: true
                  },
                  emailConfirm: {
                      required: {
                          depends: function(element) {
                              return $("#email").is(":filled");
                          }
                      },
                      email: true,
                      equalTo: "#email",
                  }
              },
              messages: {
                  email: {
                      required: "Email is required",
                      email: "Please enter a valid email address"
                  },
                  emailConfirm: {
                      required: "Confirm Email is required",
                      email: "Please enter a valid confirm email address",
                      equalTo: "Confirm Email must match Email"
                  }
              },
              submitHandler: function() {
  
                  bindingContext.$root.updateUserEmail;
                  return false;
              }
          });
      }    
  };
  </code></pre>