c# - Custom MediaElement -
i using mediaelements
in application creating. dynamically creating them , adding them wrap panel.
the problem need able add key them can go , locate specific one.
i going inherit mediaelement
, add key member. unfortunately can't because it's sealed class.
so tried create class containing mediaelement
, key can't add gui since not uielement
.
is there anyway can this? need able add mediaelements
, them able go , find them later can modify or remove them.
there such way. add dictrionary <string, mediaelement>
form. when adding new media element, add dictionary either. when you'll need access mediaelement can query dictionary using it's key name. you'll reference element @ same time in dictionary , on gui.
and when deleting gui, don't forget delete element dictionary either.
Comments
Post a Comment