Hello!
I'm using below code to load inkCanvases to tabs dynamically in the same tab control
- foreach (var di in DIList)
- {
- var grid = new Grid();
- var inkCanvas = new InkCanvas()
- {
- Width = grid.Width,
- HorizontalAlignment = System.Windows.HorizontalAlignment.Left,
- VerticalAlignment = System.Windows.VerticalAlignment.Top
- };
-
- SourcePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Docs\DI\" + di + ".bmp");
- img = GetBitmap(SourcePath);
-
- myImageBrush = new ImageBrush(img);
-
- myCanvas = new Canvas();
- myCanvas.Width = img.Width;
- myCanvas.Height = img.Height;
- myCanvas.Background = myImageBrush;
-
- inkCanvas.Height = img.Height;
- inkCanvas.Children.Add(myCanvas);
- inkCanvas.DefaultDrawingAttributes.Color = Colors.Red;
- grid.Children.Add(inkCanvas);
-
- var item = new TabItem();
- item.Header = di;
- item.Content = grid;
-
- cw.tabCanvas.Items.Add(item);
-
- }
So i want to change the Editing mode InkCanvasEditingMode.EraseByStroke of the Canvases when i click a button. I want it to apply for the all the canvases present. How can i do it.
when i do like this inkcanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke it works but i want it to recognize the canvases in present in the tabs and apply erase mode to all. Please help. Much thanks.