public ImageSelection(IServiceProvider?serviceProvider, LayerContainerViewModel layer, ImageShapeViewModel shape, ShapeStyleViewModel style) { _serviceProvider = serviceProvider; _layer = layer; _image = shape; _styleViewModel = style; }
public ImageDrawNode(ImageShapeViewModel image, ShapeStyleViewModel style, IImageCache imageCache, ICache <string, IDisposable> bitmapCache) : base() { Style = style; Image = image; ImageCache = imageCache; BitmapCache = bitmapCache; UpdateGeometry(); }
public override object Copy(IDictionary <object, object>?shared) { var copy = new ImageShapeViewModel(ServiceProvider) { Name = Name, State = State, Style = _style?.CopyShared(shared), IsStroked = IsStroked, IsFilled = IsFilled, Properties = _properties.CopyShared(shared).ToImmutable(), Record = _record, TopLeft = _topLeft?.CopyShared(shared), BottomRight = _bottomRight?.CopyShared(shared), Key = Key }; return(copy); }
public async void BeginDown(InputArgs args) { var factory = _serviceProvider.GetService <IFactory>(); var editor = _serviceProvider.GetService <ProjectEditorViewModel>(); (decimal sx, decimal sy) = editor.TryToSnap(args); switch (_currentState) { case State.TopLeft: { editor.IsToolIdle = false; if (editor.ImageImporter is null) { editor.IsToolIdle = true; return; } var key = await editor.ImageImporter.GetImageKeyAsync(); if (key is null || string.IsNullOrEmpty(key)) { editor.IsToolIdle = true; return; } var style = editor.Project.CurrentStyleLibrary?.Selected is { } ? editor.Project.CurrentStyleLibrary.Selected : editor.Factory.CreateShapeStyle(ProjectEditorConfiguration.DefaulStyleName); _image = factory.CreateImageShape( (double)sx, (double)sy, (ShapeStyleViewModel)style.Copy(null), key, false, false); editor.SetShapeName(_image); var result = editor.TryToGetConnectionPoint((double)sx, (double)sy); if (result is { })
public void Bind(ImageShapeViewModel image, object db, object r) { }
public IImageDrawNode CreateImageDrawNode(ImageShapeViewModel image, ShapeStyleViewModel style, IImageCache imageCache, ICache <string, IDisposable> bitmapCache) { return(new ImageDrawNode(image, style, imageCache, bitmapCache)); }