Computer 1980 – TRS-80 Model III First Z80 based product (Protocol Adaptor For Citibank– 1984) First Commercial MS-DOS product (Telex/IBM PC, 50 Baud – 1985) Started Windows Development using 16-bit Win 3.x Used: 8080/Z80, 68xxx, PDP/RSX,VAX-VMS and x86 (C, C++, C#) User Group/Meetup Co-Organizer: New York Pluralsight Study Group, XAML NYC Other interests: Windsurfing, Guitar Playing
or MVP Separation of concerns (Pattern) Separates Model and UI Separates Behavior and Structure Popular with WPF & Silverlight developers. Data Binding makes it easy to implement MVVM.
or other form data retrieval (API, LocalStorage). Create the ViewModel Encapsulate UI behavior and data from model. Create the View (HTML Markup) <label data-bind=“text: name” /> Bind the ViewModel to the view applyBindings(viewModel)
text Display text value in a DOM element html Display html in a DOM element css Add or remove CSS classes from DOM elements style Apply specific style to a DOM Element attr Set the value of any attribute on a DOM element
bindings. If Conditional inclusion of markup and any related binding based on truthy condition Ifnot Conditional inclusion of markup and any related binding based on a falsey condition with Creates a new binding context changing what descendent element bind to.
is invoked when the associated DOM element is clicked. event Add an event handler than can be bound to any event, such as keypress, mouseover or mouseout. submit Event handler used when submitting forms. enable Used to enable DOM elements only when the parameter value is true. Typically used with form elements like input, select, and textarea. disable Opposite of enable. Used in the same way.
propery on the viewmodel. hasfocus Two way binding for setting focus on an element and chekcing whether an element has focus. checked This binding is used for checkable controls. Radio button or checkbox. options Used to bind the elements of a drop-down list or multi-select list. selectedOptions Bind to elements that are currently selected. Used with select and options bindings. uniqueName Gives an element a unique name if it does not already have a name attribute.
our budget" + newValue); }); // Dispose of subscription var subscriptionCost = myViewModel.totalCost.subscribe(function(newValue) { /* do some work */ }); // ...then later... subscriptionCost.dispose();
of ko.bindingHandlers. Need to supply two functions: init update And then use it with DOM element bindings. <div data-bind=“customBindingName: someValue"> </div>
// This will be called when the binding is first applied to an element // Set up any initial state, event handlers, etc. here }, update: function (element, valueAccessor, allBindingsAccessor, VM) { // This will be called once when the binding is first // applied to an element, and again whenever the associated // observable changes value. // Update the DOM element based on the supplied values here. } };