예제 #1
0
 public RulerViewModel(Screen screen, Screen drawOn, RulerSide side) : base(false)
 {
     Side   = side;
     Screen = screen;
     DrawOn = drawOn;
     this.SubscribeNotifier();
 }
예제 #2
0
 public RulerViewModel(Screen screen, Screen drawOn, RulerSide side)
 {
     this.Subscribe();
     using (this.Suspend())
     {
         Side   = side;
         Screen = screen;
         DrawOn = drawOn;
     }
 }
예제 #3
0
        public RulerViewModel(Screen screen, Screen drawOn, RulerSide side)
        {
            Side = side;
            switch (side)
            {
            case RulerSide.Top:
                Vertical   = false;
                Horizontal = true;
                Revert     = false;
                break;

            case RulerSide.Bottom:
                Vertical   = false;
                Horizontal = true;
                Revert     = true;
                break;

            case RulerSide.Left:
                Vertical   = true;
                Horizontal = false;
                Revert     = false;
                break;

            case RulerSide.Right:
                Vertical   = true;
                Horizontal = false;
                Revert     = true;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(side), side, null);
            }
            Screen        = screen;
            DrawOn        = drawOn;
            Background    = GetBackground(ReferenceEquals(DrawOn, Screen) ? Colors.DarkGreen : Colors.DarkBlue);
            BackgroundOut = GetBackground(Colors.Black);
            Initialize();
        }