In winforms I usually do Parent.Controls.Remove(this);
to have a UserControl remove itself.
This isn't working for wpf.
My control has button on it to remove the whole UserControl, any ideas how to accomplish this in wpf?
Thanks in advance
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You will need to know the type of the
Parent
property to remove yourself from your Parent control.All Panel type parents (Grid, WrapPanel, StackPanel) have the
Children
property:i.e. for Grid:
ContentControls (Button, ContentControl, Border) have Content:
i.e. for Button: