Silverlight : Rectangle / Annotation tool edit
Posted: Fri Jul 24, 2009 10:00 am
hi
I am trying to make a simple feature where a user can add a rectangle tool to the chart , edit the text , later delete the annotation/rectangle tool
so i will have methods like addAnnotation , removAannotation and am planning to add editing using the AllowEdit = true and using Keydown event as follows
(below "annotation" can be rectangletool or annotation)
void annotation_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
currentAnnotationTool.EndEdit();
if(e.Key == Key.F2)
currentAnnotationTool.StartEdit();
}
is the below logic correct?
------------------------------
Have a flag to set which tool is selected - defalt = false
Add a annotation and set the flag to false
On click of the annotation , set the flag to true and set the currentannotation = selectedannotation
on keydown startedit on enter and endedit on F2(key can be any key)
in deleteAnnotation , remove the annotation from the chart tool collection
I am not able to hit the keydown event , I am able to hit the click event . do we have a sample to show how to use rectangletool for editing .
Also I saw that the rectangle shape "roundrectangle" is available , but the Shape property for rectangletool is readonly , so how can i have a round rectangle on my chart .
What is the use of EditorKey() eventhandler .
thanks,
Aniket
I am trying to make a simple feature where a user can add a rectangle tool to the chart , edit the text , later delete the annotation/rectangle tool
so i will have methods like addAnnotation , removAannotation and am planning to add editing using the AllowEdit = true and using Keydown event as follows
(below "annotation" can be rectangletool or annotation)
void annotation_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
currentAnnotationTool.EndEdit();
if(e.Key == Key.F2)
currentAnnotationTool.StartEdit();
}
is the below logic correct?
------------------------------
Have a flag to set which tool is selected - defalt = false
Add a annotation and set the flag to false
On click of the annotation , set the flag to true and set the currentannotation = selectedannotation
on keydown startedit on enter and endedit on F2(key can be any key)
in deleteAnnotation , remove the annotation from the chart tool collection
I am not able to hit the keydown event , I am able to hit the click event . do we have a sample to show how to use rectangletool for editing .
Also I saw that the rectangle shape "roundrectangle" is available , but the Shape property for rectangletool is readonly , so how can i have a round rectangle on my chart .
What is the use of EditorKey() eventhandler .
thanks,
Aniket