Windows Phone 7에서 정적 클래스의 필드에 바인딩 할 수있는 방법이 있습니까? WPF에서Windows Phone 7에서 정적 클래스 필드에 바인딩하는 방법은 무엇입니까?
내가 TestStatic이
public static class TestStatic
{
public static IEnumerable<string> Items
{ get { return new string[] { "Item A", "Item B", "Item C" }; } }
}
로 정의되어 있지만이 WP7에서 작동하지 않습니다
<ListBox ItemsSource="{Binding Source={x:Static local:TestStatic.Items}}" />
같은 것을 쓸 수는 오류입니다 "유형 'X : 정적' 찾을 수 없습니다. ...".
아무에게도 제안하는 방법이 있습니까?
코드 뒤에이 작업을 수행하지 않는 이유는 무엇입니까? 'ItemsSource = "{Binding}"과'this.listbox.ItemsSource = TestStatic.Items' 뒤에있는 코드 – abhinav