public void InsertImage(InlineImageViewModel imageViewModel) { RichControl.InsertContainer(new InlineUIContainer() { Child = new InlineImage(imageViewModel) }); }
public RibbonSimplePad() { InitializeComponent(); richControl.Document.Blocks.Add(new Paragraph(new Run("Select the image below to show a contextual tab."))); richControl.Document.Blocks.Add(new Paragraph(new InlineUIContainer() { Child = new InlineImage(InlineImageViewModel.Create("/RibbonDemo;component/Images/Clipart/caCompClientEnabled.png")) })); ModuleAppear += OnModuleAppear; ThemeManager.ThemeChanged += (s, e) => FontEditWidth = ThemeManager.GetIsTouchEnabled(this) ? 90 : 50; }
public static InlineImageViewModel Create(string imageSource) { InlineImageViewModel viewModel = ViewModelSource.Create(() => new InlineImageViewModel()); viewModel.Scale = 1; viewModel.ShapeType = InlineImageBorderType.None; viewModel.BorderWeight = 1; viewModel.Color = Colors.Black; viewModel.ImageSource = imageSource; return(viewModel); }
public InlineImage(InlineImageViewModel viewModel) { Shapes = new Dictionary <InlineImageBorderType, string>(); Shapes.Add(InlineImageBorderType.None, "M 0,0 L100,0 L100,100 L0,100 Z"); Shapes.Add(InlineImageBorderType.Rectangle, "M 0,0 L100,0 L100,100 L0,100 Z"); Shapes.Add(InlineImageBorderType.Circle, "M0,0 A50,50 0 0 0 0,100 A50,50 0 0 0 0,0"); Shapes.Add(InlineImageBorderType.Triangle, "M0,2L1,0L2,2Z"); Shapes.Add(InlineImageBorderType.Star, "M0,-10L2.9,-4.04L9.5,-3L4.25,1.5L5.8,8L0,5L-5.8,8L-4.25,1.5L-9.5,-3L-2.9,-4.04Z"); Shapes.Add(InlineImageBorderType.LeftArrow, "M0,0L10,5L10,3L30,3L30,-3L10,-3L10,-5Z"); Shapes.Add(InlineImageBorderType.RightArrow, "M0,0L-10,5L-10,3L-30,3L-30,-3L-10,-3L-10,-5Z"); Shapes.Add(InlineImageBorderType.UpArrow, "M0,0L5,10L3,10L3,30L-3,30L-3,10L-5,10Z"); Shapes.Add(InlineImageBorderType.DownArrow, "M0,0L5,-10L3,-10L3,-30L-3,-30L-3,-10L-5,-10Z"); InlineImageViewModel = viewModel; }
public void InsertImage(object source) { InlineImageViewModel image = InlineImageViewModel.Create(source.ToString()); ImageService.InsertImage(image); }