Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Selecting Eraser for all InkCanvases opened in tabs
Lahiru Mahagamage
Jan 14 2018 2:23 PM
182
Reply
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);
// cw.DI.Add(di);
}
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.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
how to deploy web application on IIS on windows server
Traffic light simulation for a crossroad