Esempio n. 1
0
            public void UnbindPlotCommand()
            {
                var c = new PlotController();

                c.Unbind(PlotCommands.SnapTrack);
                Assert.IsFalse(c.InputCommandBindings.Any(b => b.Command == PlotCommands.SnapTrack));
            }
Esempio n. 2
0
            public void UnbindLeftMouseButton()
            {
                var c = new PlotController();

                c.Unbind(new OxyMouseDownGesture(OxyMouseButton.Left));
                Assert.IsFalse(c.InputCommandBindings.Any(b => b.Gesture.Equals(new OxyMouseDownGesture(OxyMouseButton.Left))));
            }
Esempio n. 3
0
        public static Example TrackerFiresDistance()
        {
            var model = new PlotModel
            {
                Title    = "Specified distance of the tracker fires",
                Subtitle = "Press the left mouse button to test the tracker.",
            };

            model.Series.Add(new FunctionSeries(Math.Sin, 0, 10, 100));

            // create a new plot controller with default bindings
            var plotController = new PlotController();

            // remove a tracker command to the mouse-left/touch down event by default
            plotController.Unbind(PlotCommands.SnapTrack);
            plotController.Unbind(PlotCommands.SnapTrackTouch);

            // add a tracker command to the mouse-left/touch down event with specified distance
            plotController.BindMouseDown(
                OxyMouseButton.Left,
                new DelegatePlotCommand <OxyMouseDownEventArgs>((view, controller, args) =>
                                                                controller.AddMouseManipulator(
                                                                    view,
                                                                    new TrackerManipulator(view)
            {
                Snap       = true,
                PointsOnly = false
            },
                                                                    args)));
            plotController.BindTouchDown(
                new DelegatePlotCommand <OxyTouchEventArgs>((view, controller, args) =>
                                                            controller.AddTouchManipulator(
                                                                view,
                                                                new TouchTrackerManipulator(view)
            {
                Snap       = true,
                PointsOnly = false
            },
                                                                args)));

            return(new Example(model, plotController));
        }
 public void UnbindPlotCommand()
 {
     var c = new PlotController();
     c.Unbind(PlotCommands.SnapTrack);
     Assert.IsFalse(c.InputCommandBindings.Any(b => b.Command == PlotCommands.SnapTrack));
 }
 public void UnbindLeftMouseButton()
 {
     var c = new PlotController();
     c.Unbind(new OxyMouseDownGesture(OxyMouseButton.Left));
     Assert.IsFalse(c.InputCommandBindings.Any(b => b.Gesture.Equals(new OxyMouseDownGesture(OxyMouseButton.Left))));
 }