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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -