Пример #1
0
        public ViewportAxis()
        {
            PropertyChanged += (sender, e) => {
                // model-world sync
                if (!_updating)
                {
                    _updating = true;
                    switch (e.PropertyName)
                    {
                    case nameof(Model):
                        _view = new ViewRange(ModelToView(_model.Start), ModelToView(_model.End));
                        break;

                    case nameof(View):
                        _model = new ViewRange(ViewToModel(_view.Start), ViewToModel(_view.End));
                        break;
                    }
                    _updating = false;

                    UpdateCache();
                }
            };
        }
Пример #2
0
 public Log10Axis()
 {
     // избавляемся от дефолтного нуля
     Model = new ViewRange(0.1, 10);
 }