예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            state = new MainWindowState();
            state.Shortcuts.CollectionChanged += OnUpdateShortcuts;
            DataContext = state;

            Width  = 300;
            Height = SystemParameters.VirtualScreenHeight;

            Top  = 0;
            Left = SystemParameters.VirtualScreenWidth - this.Width;

            var xMin = SystemParameters.VirtualScreenWidth - this.Width;
            var xMax = SystemParameters.VirtualScreenWidth;
            var yMin = 0;
            var yMax = SystemParameters.VirtualScreenHeight;

            mousePosition = new MouseTracker();
            mousePosition.OnCursorInside  += MouseInPosition;
            mousePosition.OnCursorOutside += MouseOutPosition;
            mousePosition.RegisterPositionRectangle(xMin, xMax, yMin, yMax);
            mousePosition.StartTracking();
        }