Hi All
I am working to implement an annotation tool that includes a pulldown menu of standard text items. While using the tool, launched from the create feature pane, the user can select a text item from the menu and it would update the text for the tool so that the current item would be created using that text. I can make it work on completion of the sketch, but I need to update it before that so the user can make sure the annotation fits in the desired location.
I am updating the tool's current template, but that change is not reflected in the pane or on the tool itself.
This code is triggered by the propertychanged event on the embedded tool options pane.
private void UpdateStampToolText(string stampToolText)
{
if (CurrentTemplate == null || stampToolText == null) return;
QueuedTask.Run(() =>
{
this.CurrentTemplate.Inspector["TextString"] = stampToolText;
});
}
Am I missing something?
Thanks!
- Dave
Solved! Go to Solution.
I think I've answered my own question. Using the annotation properties object allowed me to adjust the current annotation text.
private void UpdateStampToolText(string stampToolText)
{
if (CurrentTemplate == null || stampToolText == null) return;
QueuedTask.Run(() =>
{
Inspector inspector = this.CurrentTemplate.Inspector;
AnnotationProperties annoProperties = inspector.GetAnnotationProperties();
annoProperties.TextString = stampToolText;
inspector.SetAnnotationProperties(annoProperties);
});
}
I think I've answered my own question. Using the annotation properties object allowed me to adjust the current annotation text.
private void UpdateStampToolText(string stampToolText)
{
if (CurrentTemplate == null || stampToolText == null) return;
QueuedTask.Run(() =>
{
Inspector inspector = this.CurrentTemplate.Inspector;
AnnotationProperties annoProperties = inspector.GetAnnotationProperties();
annoProperties.TextString = stampToolText;
inspector.SetAnnotationProperties(annoProperties);
});
}