public void Load() { _renderElement = new Grid(); _media = new MediaElement() { Margin= new Thickness(0,0,0,80)}; //_media.SetValue(Canvas.ZIndexProperty, 10); _mediaControls = new MediaControls() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Bottom, Height = 80 }; //_mediaControls.SetValue(Canvas.ZIndexProperty, 11); _mediaControls.DataContext = _media; _renderElement.Children.Add(_media); _renderElement.Children.Add(_mediaControls); }
public void Load() { _renderElement = new Grid(); _media = new MediaElement() { Margin = new Thickness(0, 0, 0, 80) }; //_media.SetValue(Canvas.ZIndexProperty, 10); _mediaControls = new MediaControls() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Bottom, Height = 80 }; //_mediaControls.SetValue(Canvas.ZIndexProperty, 11); _mediaControls.DataContext = _media; _renderElement.Children.Add(_media); _renderElement.Children.Add(_mediaControls); }
public void Unload() { if (_media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Opening || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Paused || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Playing || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Stopped || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Buffering || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Closed) { _media?.Stop(); } _renderElement.Children.Remove(_media); _mediaControls.DataContext = null; _renderElement.Children.Remove(_mediaControls); _media = null; _mediaControls = null; _renderElement = null; }
public void Unload() { if(_media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Opening || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Paused || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Playing || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Stopped || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Buffering || _media.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Closed) _media?.Stop(); _renderElement.Children.Remove(_media); _mediaControls.DataContext = null; _renderElement.Children.Remove(_mediaControls); _media = null; _mediaControls = null; _renderElement = null; }