I have a user control that contains button as follows
<UserControl x:Class="MyNamespace.myuseercontrol>
<Button Name="uxRemove" Grid.Row="2" Grid.Column="5" VerticalAlignment="Center"
HorizontalAlignment="Right" Width="70" Content="Remove"
Click="uxRemove_Click"/>
</UserControl>
the main window is as follows:
<Window>
<stackpanel>
<local:MyUserControl x:Name="uxPanel1" />
</stackpanel>
</Window>
Requirements:
- I’d like to fire an event on the parent window when the event uxRemove_Click is fired at the usercontrl.
- I’d like to add property Isenabled to the stackpanel “Usercontrol container” that will be based upon My usercontrol.IsEnabled property.
The MDI-style solution may be a bit overcomplicated for what you are doing.
There is an example of raising events from child controls to a parent window here.
This is the basic gist:
This is a much simpler solution for you than implementing an MDI style WPF application.