나는 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();
}
사람이 내 문제를 해결 할 수있는 파일? :)
다른 대안 :( – user2835256