2016-06-17 2 views
0

을 통해 bindableproperty를 검색 나는 다음과 같은 코드 2 줄이 있습니다자 마린 반사

var setter = new Setter(); 
setter.Property = styleType.GetRuntimeProperty(propName) as BindableProperty; 

그러나 PropertyInfo 및 BindableProperty 실제로 그들의 기업에 매우 관련이없는만큼이 분명 잘못이다. 그래서 ...이게 어떻게 완성 되었습니까? "(즉,

 var setter = new Setter(); 
     setter.Property = (BindableProperty)styleType.GetRuntimeField(propName).GetValue(null); 

하는 PROPNAME이 BindableProperty의 이름이 아닌 자산이 될 것입니다 :

답변

0

BindableProperty 인스턴스는 일반적으로 클래스의 정적 필드에 저장됩니다, 그래서 당신은 같은에 대한 참조를 얻는 것 CommmandProperty "대신"Command "를 사용합니다).