问题描述:

I have a MoveThumb class that extends Thumb, and I have a member integer m_iIndex that I want to set in xaml in this kind of way...

<s:MoveThumb x:Name="LeftRightControl"

Template="{StaticResource MoveThumbTemplate}"

DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"

Cursor="SizeAll"

Index="2"/>

code behind:

 public class MoveThumb : Thumb, INotifyPropertyChanged

{

public int m_iIndex;

public int Index

{

get

{

return m_iIndex;

}

set

{

m_iIndex = value;

}

}

...

How do I do this?

相关阅读:
Top