c# - Change Polygon color -
i adding mouseenter
event handler c# code follows:
var polygon = new polygon { strokethickness = 1, fill = brushes.blue }; polygon.mouseenter += new mouseeventhandler(p_mouseleftbuttondown2); ... void p_mouseleftbuttondown2(object sender, mouseeventargs e) { messagebox.show("entered"); }
how can change color of polygon in p_mouseleftbuttondown2
?
just put p_mouseleftbuttondown2
method:
((polygon)sender).fill = brushes.black; //whatever color need
if you, however, possibility of replacing whole code-behind mvvm approach.
Comments
Post a Comment