Exemplo n.º 1
0
        private void UpdateDataPointTemplates(RunChartView instance)
        {
            if (instance.RunChart.ActualHeight > 1 && instance.RunChart.Height >= 1)
            {
                instance.RunChart.Height -= 1;               
                _restoreBorder = true;
            }

            if (_firstUpdate)
            {
                Observable.FromEventPattern<SizeChangedEventHandler, SizeChangedEventArgs>(
                    handler => instance.RunChart.SizeChanged += handler,
                    handler => instance.RunChart.SizeChanged -= handler
                ).SubscribeWeakly(this, (target, handler) =>
                {
                    if (target._restoreBorder)
                    {
                        target.RunChart.Height += (handler.EventArgs.PreviousSize.Height - handler.EventArgs.NewSize.Height);
                        target._restoreBorder = false;
                    }
                });

                _firstUpdate = false;
            }
        }
Exemplo n.º 2
0
        private void UpdatePoints(RunChartView instance, EventPattern<PropertyChangedEventArgs> handler)
        {
            if (((ChartBase)DataContext).DataSource.Count > 0)
            {
                if (handler.EventArgs.PropertyName == "USL" || handler.EventArgs.PropertyName == "LSL")
                    UpdateDataPointTemplates(instance);

                if (handler.EventArgs.PropertyName.Contains("Show"))
                    OnPropertyChanged("ShowSpecsCheckbox");
            }
        }
Exemplo n.º 3
0
 private void OnDataContextPropertyChanged(RunChartView instance, EventPattern<PropertyChangedEventArgs> handler)
 {
     if (handler.EventArgs.PropertyName.Contains("Show"))
         UpdateDataPointTemplates(instance);
 }
Exemplo n.º 4
0
        private void OnAddNativeBehavior(RunChartView currentControl, EventPattern<EventArgs> eventPattern)
        {
            Dispatcher.BeginInvoke(() =>
            {
                var nativeBehavior = ((TrackballBehavior)eventPattern.Sender);

                Observable.FromEventPattern<EventHandler<TrackBallInfoEventArgs>, TrackBallInfoEventArgs>(
                    handler => nativeBehavior.TrackInfoUpdated += handler,
                    handler => nativeBehavior.TrackInfoUpdated -= handler
                ).SubscribeWeakly(this, (target, handler) => target.ChartTrackBallBehavior_TrackInfoUpdated(handler.Sender, handler.EventArgs));

                try
                {
                    currentControl.RunChart.Behaviors.Add(nativeBehavior);
                    nativeBehavior.Parents.Add(currentControl.RunChart);
                }
                catch (InvalidOperationException){}
            });

            _isObsolete = true;
        }