I have created two Usercontrols
in my WPF Application
! I want to access function of one Usercontrol via other. I just made one usercontrol
parent of other and tried to access function of other but it generated Error that :
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.
My code is:
AllStories -- Parent UserControl
XAML-File
<dxdo:LayoutPanel Caption="Panel" Name="layoutPanel2">
<local:EditStory x:Name="editstorytab"/>
</dxdo:LayoutPanel>
.CS File
public AllStories()
{
InitializeComponent();
editstorytab.MyParent = this;
}
EditStory -- Child UserControl
.Cs File
public AllStories MyParent { get; set; }
public EditStory(AllStories parent)
{
InitializeComponent();
MyParent = parent;
EditDataRefresh();
}
Can anyone Solve my problem? :)