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

■ FrameworkElement 클래스의 TryFindResource 메소드를 사용해 리소스를 찾는 방법을 보여준다.

 

▶ 예제 코드 (C#)

using System.Windows;

Style style = this.button.TryFindResource("RedForegroundStyleKey") as Style;

if(style != null)
{
    this.button.Style = style;
}

※ 찾고자 하는 리소스가 존재하지 않는 경우 TryFindResource 메소드는 null를 반환한다.

728x90
그리드형(광고전용)
Posted by icodebroker
,