/// <summary> /// Initializes this instance. /// </summary> private void Initialize(DrawingPresentationModel drawingPresentationModelData, Model modelData) { _drawingPresentationModel = drawingPresentationModelData; _model = modelData; _graphicsAdapter = new DrawingPageGraphicsAdapter(_canvas); // Observers SubscribeEvents(); // UI SubscribeViewEvents(); // Initial UI States _drawingPresentationModel.Initialize(); UpdateUndoRedoButtonEnabledStates(); _canvas.Loaded += (sender, eventArguments) => _model.Initialize(_canvas.ActualWidth, _canvas.ActualHeight, ShapeDrawerType.None); // The actual width and height of the canvas can only be determined after it is completely loaded. }
public DrawingForm(DrawingPresentationModel drawingPresentationModelData, Model modelData) { InitializeComponent(); _drawingPresentationModel = drawingPresentationModelData; _model = modelData; this.Disposed += RemoveEvents; // Observers SubscribeEvents(); // UI SubscribeViewEvents(); // Initial UI States _drawingPresentationModel.Initialize(); UpdateUndoRedoButtonEnabledStates(); _model.Initialize(_canvas.Size.Width, _canvas.Size.Height, ShapeDrawerType.None); }
public void TestInitialize() { _drawingPresentationModel.Initialize(); Assert.IsTrue(_buttonEnabledStatesManager.IsCalledInitialize); }