© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
Clara

❔ Removing items from a XAML window

I'm working on a small video game that I'm visualising with WPF.
The issue I have is that I can't quite figure out how to remove an entity from the window. For example, I have a little wizard, who shoots fireballs and I'd like those fireballs to disappear when the hit something.
MainWindow.worldEntityList.Remove(this)
MainWindow.worldEntityList.Remove(this)
hasn't really been doing the trick. I've tested a few things and can confirm that the fireballs are aware they've hit something (they deal damage to the enemies' healthbars), but I can't get rid of them. Or the enemies when they drop to 0hp, for that matter. Any clues you might be able to give me would be very much appreciated.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Troubleshooting xaml - initialize window
C#CC# / help
15mo ago
✅ xaml
C#CC# / help
9mo ago
❔ XAML
C#CC# / help
3y ago