public TimeLineMemoryViewModel(TimelineMemoryView control) { //SizePointCollection = new PointCollection(); _taskWorker = new AlaskaTasKWorker(); SizePointList = new BindingList<Point>(); UsedPointList = new BindingList<Point>(); _control = control; _control.SizeChanged += _control_SizeChanged; //BindingOperations.EnableCollectionSynchronization(SizePointCollection, _pointsLock); //AddPoint(0, 0); }
public TimelineRulerViewModel(TimelineRulerView control, DateTime startTime, DateTime endTime, double scale) { _taskWorker = new AlaskaTasKWorker(); //temporary solution Marks = new ObservableCollection<TimelineRulerMarkModel>(); BindingOperations.EnableCollectionSynchronization(Marks, _marksLock); _control = control; Scale = scale == 0 ? 100 : scale; StartTime = startTime; EndTime = endTime; /* ULTRA MEGA HACK BINDING */ var b = new Binding("ActualWidth"); b.RelativeSource = new RelativeSource(RelativeSourceMode.Self); _control.SetBinding(TimelineRulerView.ObservedWidthProperty, b); /*-------------------------*/ BuildMarks(); }