Windows Phone 7
[wp7] UserControl 안의 Property를 부모의 컨트롤에 바인딩하기
동동(이재동)
2012. 1. 3. 21:20
예를들어 하위 UserControl 안에
public double CurrentCount { get; set; }
이런 property가 있다고 하자. 이것을 하위 View에서 보고 싶다. 그럴때는?
바인딩을 이렇게 하면 된다.
<ct:SelectPersonControl Margin="10" x:Name="SPC"/>
<TextBlock Text="{Binding Path=CurrentCount, ElementName=SPC}" />
이렇게 하면 UserControl의 CurrentCount값이 바인딩 된다.
너무 기초인가… 혹시나 하는 마음에 알아두길~