コード例 #1
0
        private void thumbDragCompleted(SplitPositionBarViewModel barViewModel, SplitPositionItem item)
        {
            barViewModel.CheckAndRemoveBorderItem(item);

            this.Cursor = Cursors.Arrow;
            this.imageViewModel.ShowCursorLine = true;
        }
コード例 #2
0
        private void verticalBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int y = this.verticalPositionConverter.ConvertViewPositionToImagePosition(e.GetPosition(verticalBar).Y);

            if (0 < y && y < this.verticalPositionConverter.GetMaxImagePosition())
            {
                SplitPositionItem item = new SplitPositionItem()
                {
                    Position = y
                };
                imageViewModel.VerticalSplitPositionBarViewModel.PositionList.Add(item);
            }
        }
コード例 #3
0
        private void horizontalBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int x = this.horizontalPositionConverter.ConvertViewPositionToImagePosition(e.GetPosition(horizontalBar).X);

            if (0 < x && x < this.horizontalPositionConverter.GetMaxImagePosition())
            {
                SplitPositionItem item = new SplitPositionItem()
                {
                    Position = x
                };
                imageViewModel.HorizontalSplitPositionBarViewModel.PositionList.Add(item);
            }
        }
コード例 #4
0
        public void CheckAndRemoveBorderItem(SplitPositionItem item)
        {
            int pos = item.Position;
            if (pos <= MinPosition)
            {
                PositionList.Remove(item);
            }
            if (pos >= MaxPosition)
            {
                PositionList.Remove(item);
            }

            bool samePositionExists = (PositionList.Count((other) => { return (item != other && other.Position == pos); }) > 0);
            if (samePositionExists) {
                PositionList.Remove(item);
            }
        }
コード例 #5
0
        public void CheckAndRemoveBorderItem(SplitPositionItem item)
        {
            int pos = item.Position;

            if (pos <= MinPosition)
            {
                PositionList.Remove(item);
            }
            if (pos >= MaxPosition)
            {
                PositionList.Remove(item);
            }

            bool samePositionExists = (PositionList.Count((other) => { return(item != other && other.Position == pos); }) > 0);

            if (samePositionExists)
            {
                PositionList.Remove(item);
            }
        }
コード例 #6
0
        void positionItem_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName != "Position")
            {
                return;
            }

            SplitPositionItem item = (SplitPositionItem)sender;

            if (item.Position < MinPosition)
            {
                item.Position = MinPosition;
            }
            else if (item.Position > MaxPosition)
            {
                item.Position = MaxPosition;
            }

            OnAnyPositionChanged();
        }
コード例 #7
0
 private void thumbDragDelta(SplitPositionItem item, ImagePositionConverter converter, double change)
 {
     item.Position += converter.ConvertViewPositionToImagePosition(change);
 }
コード例 #8
0
        private void verticalBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int y = this.verticalPositionConverter.ConvertViewPositionToImagePosition(e.GetPosition(verticalBar).Y);

            if (0 < y && y < this.verticalPositionConverter.GetMaxImagePosition())
            {
                SplitPositionItem item = new SplitPositionItem() { Position = y };
                imageViewModel.VerticalSplitPositionBarViewModel.PositionList.Add(item);
            }
        }
コード例 #9
0
 private void thumbDragDelta(SplitPositionItem item, ImagePositionConverter converter, double change)
 {
     item.Position += converter.ConvertViewPositionToImagePosition(change);
 }
コード例 #10
0
        private void thumbDragCompleted(SplitPositionBarViewModel barViewModel, SplitPositionItem item)
        {
            barViewModel.CheckAndRemoveBorderItem(item);

            this.Cursor = Cursors.Arrow;
            this.imageViewModel.ShowCursorLine = true;
        }
コード例 #11
0
        private void horizontalBar_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            int x = this.horizontalPositionConverter.ConvertViewPositionToImagePosition(e.GetPosition(horizontalBar).X);

            if (0 < x && x < this.horizontalPositionConverter.GetMaxImagePosition())
            {
                SplitPositionItem item = new SplitPositionItem() { Position = x };
                imageViewModel.HorizontalSplitPositionBarViewModel.PositionList.Add(item);
            }
        }