Adding and altering multiple text items to a Canvas -- what approach?
Posted
by
philologon
on Stack Overflow
See other posts from Stack Overflow
or by philologon
Published on 2012-10-17T16:57:27Z
Indexed on
2012/10/17
17:00 UTC
Read the original article
Hit count: 234
I am attempting to use a Canvas to create a simple Cad application. I have been able to get lines to draw as I want. For now the only other thing I need is text. The user should be able to edit the text in place. ?Is one of these better to use for this over the others?
- Rich Text
- TextBlock
- TextBox
- Label
A more important question, though, is once I have chosen which class to use for implementation, how do I set and get the text value in code? Since the app is in essence a cad application, text will be added, deleted, and altered often, so I am not attempting to put these in XAML, but code-behind. That is why I am asking about how to do this in code.
If the answer is "use X.SetValue()" (or that family of methods), then please tell me what I am supposed to do with the required DependencyProperty reference?
TIA.
- Paul
© Stack Overflow or respective owner