This method is static.This example was placed on a button click event. It uses the first method to get the first item with the name of viewParameter1.
// Get the parent view.
var parentView = this.parentView;
// Get the view parameters.
var viewParameters =
parentView.control.viewParameters;
// Using the library, get the view parameter based on it's name
var viewParameter =
viewParameters.toEnumerable().first(
function (viewParameterItem) { return viewParameterItem.name === "viewParameter1";}
);