}
        */
        ko.bindingHandlers.virtualization = {
            init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {

                var eventString = valueAccessor().event,
                    callback = valueAccessor().callback,
                    syncViewModel = valueAccessor().syncViewModel;
                
                // Function used to parse the JSON data received back from the request.
                // If a syncViewModel was provided, it will attempt to use sync on the retrieved data.
                // Otherwise it will call the callback function passing the parsed data.
                function syncVirtualizedData(data) {
                    if (syncViewModel != null) {
                        presenter.updateViewModel(data, syncViewModel, issueCallback);
                    } else {
                        var model = JSON.parse(data.json);
                        issueCallback(model);
                    }
                }
                                
                // Function used to invoke the callback function if a valid one has been provided.
                function issueCallback(data, syncData) {
                    if (typeof callback === "function") {
                        callback(data);
                    }
                }

                // Requests the data based on the event string passed to the binding.
                // This will only retrieve data the first time, unless explicitly cleared in C#.
                if (viewModel.hasOwnProperty("HasVirtualizedData") &&
                    ko.isObservable(viewModel.HasVirtualizedData) &&
                    viewModel.HasVirtualizedData() === true) {
                    ko.utils.registerEventHandler(element, eventString, function (event) {
                        
                        if (!viewModel.HasReusableData() && viewModel.HasVirtualizedData()) {
                            proxy.request("GetVirtualizedData",
                                viewModel.id,
                                function (data) {
                                    syncVirtualizedData(data);
                                },
                                function () {
                                    window.console.log("GetVirtualizedData has errored. id: " + viewModel.id);
                                });
                        }

                    });
                }
            }
        };

    });