当前位置: 动力学知识库 > 问答 > 编程问答 >

How to set a variable in xaml

问题描述:

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?

分享给朋友:
您可能感兴趣的文章:
随机阅读: