public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = inflater.Inflate(Resource.Layout.Analyse, container, false);

            Bundle      b  = this.Arguments;
            TrackParcel tp = (TrackParcel)b.GetParcelable("Track");

            this.Track = tp.Track;
            this.Arguments.Remove("Track");

            RadioGroup rgGraph = view.FindViewById <RadioGroup>(Resource.Id.rgGraph);

            rgGraph.CheckedChange += this.UpdateGraphType;

            this.Graph = view.FindViewById <PlotView>(Resource.Id.plot_view);

            return(view);
        }
        private void SetGraphType(int type)
        {
            Bundle      b  = this.Arguments;
            TrackParcel tp = (TrackParcel)b.GetParcelable("Track");

            switch (type)
            {
            case Resource.Id.rbDistanceTraveledGraph:
                this.Graph.Model = this.CreateDistanceTraveledModel(this.Track);
                break;

            case Resource.Id.rbSpeedGraph:
            default:
                this.Graph.Model = this.CreateSpeedModel(this.Track);
                break;
            }

            this.View.FindViewById <RadioButton>(type).Checked = true;

            this.Graph.Invalidate();
        }