사용자 컨트롤 MyUserControl을 만들었습니다. 이제 MyUserControl에서 파생 된 MyCustomControl 사용자 지정 컨트롤을 만들고 싶습니다. MyCustomControl.cs 코드는 다음입니다 :ArgumentException 사용자 컨트롤에서 파생 된 사용자 지정 컨트롤의 DefaultStyleKey - Silverlight 4
내가 테마를 가지고public class MyCustomControl : MyUserControl
{
public MyCustomControl()
{
this.DefaultStyleKey = typeof(MyCustomControl);
}
}
/generic.xaml을 내가 줄을 실행 ArgumentException이를 얻을 수 런타임에 MyCustomControl 인스턴스화 스타일
<Style TargetType="local:MyCustomControl">
...
</Style>
와 파일
this.DefaultStyleKey = typeof(MyCustomControl);
무엇이 누락 되었습니까?
나는 본다. 감사! CustomControl1을 기본 스타일로 생성 한 다음 CustomControl2에서 생성 한 CustomControl2를 CustomControl2와 함께 만들 수 있습니까? 처음에이 시나리오를 시도했지만 런타임에 System.Exception이 발생했습니다. – EvAlex