첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

■ Binding 객체의 UpdateSourceTrigger 속성을 UpdateSourceTrigger.Explicit로 설정시 BindingExpression 클래스의 UpdateSource 메소드를 사용하는 방법을 보여준다.

 

▶ 예제 코드 (C#)

using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;

ScrollBar sourceScrollBar;
Label     targetLabel;

...

Binding binding = new Binding();

binding.Source              = sourceScrollBar;
binding.Path                = new PropertyPath(ScrollBar.ValueProperty);
binding.Mode                = BindingMode.OneWay;
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;

targetLabel.SetBinding(Label.ContentProperty, binding);

...

BindingExpression bindingExpression = targetLabel.GetBindingExpression(Label.ContentProperty);

bindingExpression.UpdateSource();
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요