Monday, 15 February 2010

WPF-MVVM: TabItem Header click event handling in viewmodel -



WPF-MVVM: TabItem Header click event handling in viewmodel -

i found out alot of answers handling tabitem header click event in code behind need handle event in view model. in advance

bind property tab command selectedindex.

your xaml:

<tabcontrol x:name="tabcontrol" selectedindex="{binding tabcontrolselectedindex}">

your viewmodel:

class="lang-vb prettyprint-override">private _tabcontrolselectedindex integer public property tabcontrolselectedindex integer homecoming _tabcontrolselectedindex end set(value integer) if _tabcontrolselectedindex <> value _tabcontrolselectedindex = value onpropertychanged("tabcontrolselectedindex") ' ' whatever want handle here ' end if end set end property

wpf mvvm

No comments:

Post a Comment