Example #1
0
        public MyWindow(int width, int height, ref double obj_height, ref double obj_width)
            : base(width, height)
        {
            InitializeComponent();
            //_height = obj_height;
            //_radius = obj_width;
            RenderedObjects    = FigureContainer.GetElements();
            _camera            = new Configuration.Camera(Mouse, width, height);
            _selectObjectEvent = new SelectObjectEvent(RenderedObjects, Mouse, _camera);
            _selectObjectEvent.OnSelectionChange += _selectObjectEvent_OnSelectionChange;
            //Tracking

            MouseMove = Observable.FromEvent <EventHandler <MouseMoveEventArgs>, MouseMoveEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.Move += h,
                h => Mouse.Move -= h);

            MouseRightDown = Observable.FromEvent <EventHandler <MouseButtonEventArgs>, MouseButtonEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.ButtonDown += h,
                h => Mouse.ButtonDown -= h);
            MouseRightUp = Observable.FromEvent <EventHandler <MouseButtonEventArgs>, MouseButtonEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.ButtonUp += h,
                h => Mouse.ButtonUp -= h);
        }
Example #2
0
        public MyWindow(int width, int height, string title)
            : base(width, height, GraphicsMode.Default, title)
        {
            InitializeComponent();
            RenderedObjects    = FigureContainer.GetElements();
            _camera            = new Configuration.Camera(Mouse, _width, _height);
            _selectObjectEvent = new SelectObjectEvent(RenderedObjects, Mouse, _camera);
            _selectObjectEvent.OnSelectionChange           += _selectObjectEvent_OnSelectionChange;
            GraphicManagement.cameraCommands.MoveToCommand += CameraCommands_MoveToCommand;
            //Tracking

            MouseMove = Observable.FromEvent <EventHandler <MouseMoveEventArgs>, MouseMoveEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.Move += h,
                h => Mouse.Move -= h);

            MouseRightDown = Observable.FromEvent <EventHandler <MouseButtonEventArgs>, MouseButtonEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.ButtonDown += h,
                h => Mouse.ButtonDown -= h);
            MouseRightUp = Observable.FromEvent <EventHandler <MouseButtonEventArgs>, MouseButtonEventArgs>(
                h => (s, e) => h(e),
                h => Mouse.ButtonUp += h,
                h => Mouse.ButtonUp -= h);
        }