locked
Can some one provide the link for filterbardemo application? RRS feed

  • Question

  • Hi,

    I have been writing a custom control.

    I have gone through the video "create reusable custom metro style control" [LINK].

    I understand a bit that how WinJS.Utilities.eventMixin and WinJS.Utilities.createEventProperties works.

    """ They explained in video every thing expect that how they are associating "filterinvoked" event with "click" event. """

    I have even gone through this document: Adding functionality with WinJS mixins [LINK], but didn't find what I was looking for.

    I searched a lot for the sample of this video but failed.

    Sample Code:

    var TestControl = WinJS.Class.define(
    	// constructor
    	function (element, options) {
    		element = element || document.createElement('div');
    		this._element = element;
    
    		options = options || {};
    		WinJS.Utilities.addClass(this._element, 'mytestcontrol');
    		this._element.style.width = '70vw';
    		this._element.style.height = '50vh';
    		WinJS.UI.setOptions(this._element, options);
    		element.winControl = this;
    	},
    	// members
    	{
    		items: {
    			get: function () {
    				return this._items;
    			},
    			set: function (value) {
    				this._items = value;
    			}
    		},
    
    		.
    
    		.
    
    		.
    
    		.
    	}),
    WinJS.Class.mix(TestControl, WinJS.Utilities.eventMixin);
    WinJS.Class.mix(TestControl, WinJS.Utilities.createEventProperties("iteminvoked"));

    ** Can somebody help me to solve out this problem OR provide the link to the sample.

    And one other thing is:

    How do you set items data in list view so that when it listen to "iteminvoked" event, "e.detail" contains the data.

    I have been trying using "item.detail = data" while rendering but when listening to item click event in custom control, it is accessible through "e.currentTarget.detail".

    Thanks

    • Edited by manish.zedwal Sunday, June 3, 2012 4:32 PM forgot something to ask while in first attempt
    Sunday, June 3, 2012 4:04 PM

Answers