Click here to Skip to main content
15,037,009 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
As the title say's, I tried to create this using a template.
The problem is when the text box went multiline the graphic did not relocate with it.

I wish to reuse this in many places.

Question 0: Will i have to add a Dependency Property?

Question 1: Should this be a UserControl, a resource or a template?

Thank You.
Posted
Updated 11-Mar-14 5:09am
v2
Comments
Sergey Alexandrovich Kryukov 11-Mar-14 11:54am
   
Looks like a bad idea to me. Why not adding something below the text box..?
—SA

Use a stack panel as a workaround.
E.g.
XML
<StackPanelOrientation="Horizontal">
 <Image Source="image.jpg" Visibility="Collapsed"/>
 <TextBlock Text="Text"/>
</StackPanel>
   
Comments
David C# Hobbyist. 11-Mar-14 12:27pm
   
I ended up creating a user control similar to the one on stack overflow.

Thank You for the input.
Sergey Alexandrovich Kryukov 11-Mar-14 12:40pm
   
No you didn't. :-)
—SA
Sergey Alexandrovich Kryukov 11-Mar-14 12:40pm
   
Fair enough, my 5. But please see my comments to the question and to the Solution 1.
—SA
Abhinav S 11-Mar-14 13:07pm
   
Thank you SA.
I found a idea on how to do it on SO. Here is the link for anyone interested. http://stackoverflow.com/questions/337181/how-do-i-create-a-custom-wpf-control-like-a-cartoon-bubble-with-constant-corners[^]
   
Comments
Sergey Alexandrovich Kryukov 11-Mar-14 12:39pm
   
Sorry, I down-voted you answer by some minor reasons, but serious ones:

1) I already told you such solution. This is a work-around. Exactly as I advised, it does not add anything in the text box to its bottom, it adds elements around, which is way too trivial; you did not even need to ask any questions.

2) You question was about TextBox, and your answer is about TextBlock. In the sense of the problem you tried to formulate in first place, the difference is huge. In essence, you did not answer to your own question at all, not in any sense.

Keeping the above in mind, the fact you even self-accepted your own "answer" is just outrageous. How could you do it?

—SA
David C# Hobbyist. 11-Mar-14 12:49pm
   
I understand and except your downvote. My verbal skills are indeed lacking.

As to accepting my own answer Please forgive me, but I thought it would help others.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900