Skip to content

How to use a behavior

Grega Mohorko edited this page Feb 1, 2018 · 1 revision

You must add a reference to the Behaviors namespace: xmlns:behaviors="clr-namespace:GM.WPF.Behaviors;assembly=GM.WPF".

Then you can simply use all of the behaviors: <MyControl behaviors:MyBehavior.MyProperty="Value">.


An example of using the DataGridBehavior and its DisplayRowNumber property:

<DataGrid behaviors:DataGridBehavior.DisplayRowNumber="True" />
Clone this wiki locally