public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SilverlightMediaPlayer;component/Player.xaml", System.UriKind.Relative));
     this.LayoutRoot          = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.SmoothPlayer        = ((Microsoft.Web.Media.SmoothStreaming.SmoothStreamingMediaElement)(this.FindName("SmoothPlayer")));
     this.bitRateGraph        = ((SilverlightMediaPlayer.BitrateGraphControl)(this.FindName("bitRateGraph")));
     this.framerateControl    = ((SilverlightMediaPlayer.FramerateGraphControl)(this.FindName("framerateControl")));
     this.maxFramerateControl = ((SilverlightMediaPlayer.MaxBitrateLimiterControl)(this.FindName("maxFramerateControl")));
     this.eventLogViewer      = ((SilverlightMediaPlayer.EventsLog)(this.FindName("eventLogViewer")));
     this.ControllerContainer = ((System.Windows.Controls.Grid)(this.FindName("ControllerContainer")));
     this.playercontrols      = ((System.Windows.Controls.Grid)(this.FindName("playercontrols")));
     this.ReplayElement       = ((System.Windows.Controls.Button)(this.FindName("ReplayElement")));
     this.RewindElement       = ((System.Windows.Controls.Button)(this.FindName("RewindElement")));
     this.playButton          = ((System.Windows.Controls.Button)(this.FindName("playButton")));
     this.pauseButton         = ((System.Windows.Controls.Button)(this.FindName("pauseButton")));
     this.FastForwardElement  = ((System.Windows.Controls.Button)(this.FindName("FastForwardElement")));
     this.SlowMotionElement   = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("SlowMotionElement")));
     this.divider1            = ((System.Windows.Controls.Grid)(this.FindName("divider1")));
     this.timelinecontrols    = ((System.Windows.Controls.Grid)(this.FindName("timelinecontrols")));
     this.slider                  = ((SilverlightMediaPlayer.CustumSlider)(this.FindName("slider")));
     this.TimeContainer           = ((System.Windows.Controls.Border)(this.FindName("TimeContainer")));
     this.CurrentPositionElement  = ((System.Windows.Controls.TextBlock)(this.FindName("CurrentPositionElement")));
     this.TimeSeparatorElement    = ((System.Windows.Controls.TextBlock)(this.FindName("TimeSeparatorElement")));
     this.CurrentDurationElement  = ((System.Windows.Controls.TextBlock)(this.FindName("CurrentDurationElement")));
     this.volumeslider            = ((System.Windows.Controls.Slider)(this.FindName("volumeslider")));
     this.divider2                = ((System.Windows.Controls.Grid)(this.FindName("divider2")));
     this.functioncontrols        = ((System.Windows.Controls.Grid)(this.FindName("functioncontrols")));
     this.GraphToggleElement      = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("GraphToggleElement")));
     this.LogToggleElement        = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("LogToggleElement")));
     this.FullScreenToggleElement = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("FullScreenToggleElement")));
     this.divider3                = ((System.Windows.Controls.Grid)(this.FindName("divider3")));
 }
 private void RepaintGraph(BitrateGraphControl.BitrateGraph graph, ulong bitrate)
 {
     if (graph.CurrentLine != null)
     {
         if (graph.LastBitrate != bitrate)
         {
             Line line = this.CreateGraphLine(graph.CurrentLine.X2, this.ComputeBitrateGraphValue(bitrate), graph.CurrentLine.X2, this.ComputeBitrateGraphValue(bitrate), graph.Color);
             this._bitrateGraphCanvas.Children.Add(line);
             Line line1 = this.CreateGraphLine(graph.CurrentLine.X2, graph.CurrentLine.Y1, graph.CurrentLine.X2, line.Y1, graph.Color);
             this._bitrateGraphCanvas.Children.Add(line1);
             graph.CurrentLine = line;
         }
         else if (graph.CurrentLine.X2 >= 500)
         {
             foreach (Line mLine in this.m_lines)
             {
                 if ((mLine == null ? false : mLine.Visibility == Visibility.Visible))
                 {
                     if (mLine.X1 > 60)
                     {
                         Line x1 = mLine;
                         x1.X1 = x1.X1 - 1;
                     }
                     if (mLine.X2 <= 60)
                     {
                         mLine.Visibility = Visibility.Collapsed;
                     }
                     else
                     {
                         Line x2 = mLine;
                         x2.X2 = x2.X2 - 1;
                     }
                 }
             }
             Line currentLine = graph.CurrentLine;
             currentLine.X2 = currentLine.X2 + 1;
         }
         else
         {
             Line currentLine1 = graph.CurrentLine;
             currentLine1.X2 = currentLine1.X2 + 1;
         }
         graph.LastBitrate = bitrate;
     }
     else
     {
         graph.LastBitrate = bitrate;
         graph.CurrentLine = this.CreateGraphLine(60, this.ComputeBitrateGraphValue(bitrate), 60, this.ComputeBitrateGraphValue(bitrate), graph.Color);
         this._bitrateGraphCanvas.Children.Add(graph.CurrentLine);
     }
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SilverlightMediaPlayer;component/Player.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.SmoothPlayer = ((Microsoft.Web.Media.SmoothStreaming.SmoothStreamingMediaElement)(this.FindName("SmoothPlayer")));
     this.bitRateGraph = ((SilverlightMediaPlayer.BitrateGraphControl)(this.FindName("bitRateGraph")));
     this.framerateControl = ((SilverlightMediaPlayer.FramerateGraphControl)(this.FindName("framerateControl")));
     this.maxFramerateControl = ((SilverlightMediaPlayer.MaxBitrateLimiterControl)(this.FindName("maxFramerateControl")));
     this.eventLogViewer = ((SilverlightMediaPlayer.EventsLog)(this.FindName("eventLogViewer")));
     this.ControllerContainer = ((System.Windows.Controls.Grid)(this.FindName("ControllerContainer")));
     this.playercontrols = ((System.Windows.Controls.Grid)(this.FindName("playercontrols")));
     this.ReplayElement = ((System.Windows.Controls.Button)(this.FindName("ReplayElement")));
     this.RewindElement = ((System.Windows.Controls.Button)(this.FindName("RewindElement")));
     this.playButton = ((System.Windows.Controls.Button)(this.FindName("playButton")));
     this.pauseButton = ((System.Windows.Controls.Button)(this.FindName("pauseButton")));
     this.FastForwardElement = ((System.Windows.Controls.Button)(this.FindName("FastForwardElement")));
     this.SlowMotionElement = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("SlowMotionElement")));
     this.divider1 = ((System.Windows.Controls.Grid)(this.FindName("divider1")));
     this.timelinecontrols = ((System.Windows.Controls.Grid)(this.FindName("timelinecontrols")));
     this.slider = ((SilverlightMediaPlayer.CustumSlider)(this.FindName("slider")));
     this.TimeContainer = ((System.Windows.Controls.Border)(this.FindName("TimeContainer")));
     this.CurrentPositionElement = ((System.Windows.Controls.TextBlock)(this.FindName("CurrentPositionElement")));
     this.TimeSeparatorElement = ((System.Windows.Controls.TextBlock)(this.FindName("TimeSeparatorElement")));
     this.CurrentDurationElement = ((System.Windows.Controls.TextBlock)(this.FindName("CurrentDurationElement")));
     this.volumeslider = ((System.Windows.Controls.Slider)(this.FindName("volumeslider")));
     this.divider2 = ((System.Windows.Controls.Grid)(this.FindName("divider2")));
     this.functioncontrols = ((System.Windows.Controls.Grid)(this.FindName("functioncontrols")));
     this.GraphToggleElement = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("GraphToggleElement")));
     this.LogToggleElement = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("LogToggleElement")));
     this.FullScreenToggleElement = ((System.Windows.Controls.Primitives.ToggleButton)(this.FindName("FullScreenToggleElement")));
     this.divider3 = ((System.Windows.Controls.Grid)(this.FindName("divider3")));
 }