//public override void OnApplyTemplate() //{ // //m_rootElement = GetTemplateChild("RootElement") as Panel; //} protected override void init() { MediaData.MediaItem m = MediaCollect.MediaItems[0]; switch (m.ItemType) { case MultiMediaPlayer.MediaData.MediaType.Video: VideoControl v = new VideoControl(); v.SetData(m); m_rootElement.Children.Add(v); break; } }