ArcGISWindowsPhoneSDK.VideoFills.GraphicsLayer_MouseLeftButtonDown C# (CSharp) Method

GraphicsLayer_MouseLeftButtonDown() private method

private GraphicsLayer_MouseLeftButtonDown ( object sender, GraphicMouseButtonEventArgs e ) : void
sender object
e GraphicMouseButtonEventArgs
return void
        private void GraphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
        {
            string stateName = Convert.ToString(e.Graphic.Attributes["STATE_NAME"]);

            foreach (Graphic g in _lastActiveGraphics)
                g.Symbol = LayoutRoot.Resources["TransparentFillSymbol"] as Symbol;
            _lastActiveGraphics.Clear();

            if (_lastActiveGraphics.Count > 0)
            {
                for (int i = 0; i < _lastActiveGraphics.Count; i++)
                {
                    if (Convert.ToString(_lastActiveGraphics[i].Attributes["STATE_NAME"]) != stateName)
                        ClearVideoSymbol(_lastActiveGraphics[i]);
                    else
                        return;
                }
            }

            GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;

            Grid videoGrid = FindName("MediaGrid") as Grid;
            videoGrid.Children.Clear();

            MediaElement stateMediaElement = new MediaElement()
            {
                Source = new Uri(String.Format("http://serverapps.esri.com/media/{0}_small.wmv", stateName), UriKind.Absolute),
                Stretch = Stretch.None,
                AutoPlay = true,
                IsMuted = true,
                Opacity = 0.0,
                IsHitTestVisible = false
            };
            stateMediaElement.MediaEnded += State_Media_MediaEnded;
            videoGrid.Children.Add(stateMediaElement);
            //FillSymbol stateVideoFillSymbol = LayoutRoot.Resources["StateVideoFillSymbol"] as FillSymbol;
            FillSymbol stateVideoFillSymbol = LayoutRoot.Resources["RedFillSymbol"] as FillSymbol;
            //(stateVideoFillSymbol.Fill as VideoBrush).SetSource(stateMediaElement);
            e.Graphic.Symbol = stateVideoFillSymbol;

            _lastActiveGraphics.Add(e.Graphic);
        }