2013-10-14 8 views
0

나는 WPF Application에 두 Usercontrols을 만들었습니다! 다른 하나를 통해 하나의 Usercontrol의 기능에 액세스하려고합니다. 난 그냥 다른 하나 usercontrol 부모를 만들어 다른 기능에 액세스하려고하지만, 그 오류 발생 :부모 및 자식 UserControl 오류

Error 2 The type 'EditStory' cannot have a Name attribute. Value types and types without a default constructor can be used as items within a ResourceDictionary.

내 코드는 다음과 같습니다

AllStories - 부모 UserControl을

XAML 파일

<dxdo:LayoutPanel Caption="Panel" Name="layoutPanel2"> 
        <local:EditStory x:Name="editstorytab"/> 
       </dxdo:LayoutPanel> 

.CS 파일

public AllStories() 
    { 
     InitializeComponent(); 
     editstorytab.MyParent = this; 

    } 

EditStory - 아이 UserControl을

.Cs

public AllStories MyParent { get; set; } 
    public EditStory(AllStories parent) 
    { 

     InitializeComponent(); 
     MyParent = parent; 
     EditDataRefresh(); 
    } 

사람이 내 문제를 해결 할 수있는 파일? :)

답변

0

this 대답에서 :

귀하의 기본 창은 분명히 오류 상태로, 공공 기본 생성자 (인수가없는 한), 또한 추상적하지 않을 수 있습니다을 필요로하기 때문에의 인스턴스 생성해야합니다.

+0

다른 대안 :( – user2835256

관련 문제