Hi Friends,
I have an xml document as below.
< Student >
...
< Phone >111 < /Phone >
< Phone >111 < /Phone >
< Phone >111 < /Phone>
< Phone >111 < /Phone>
...
< /Student>
I need to display all the Phone entries in some UI. I can easily do this by binding a WPF ListView with Phone entries.
But I don't want to use WPF ListView for this. Instead I want a user control just like the
TO, CC and BCC text boxes we have in Yahoo or Hotmail email account. You can see in Yahoo or Hotmail email account that while sending an email, they show each email address in separate boxes. I can't attach a snapshot here so please log-in your account to see the exact behavior I want. Can somebody help me about how to create a user control like those text boxes? Or if there are some links from where I can get the direction about creating them. Please help me.
Some more detail:
I am able to create a user control as I asked above by using a ListBox with data template as shown below:
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
But the problem is that I also want to give a text box after last item in WrapPanel. From above ItemTemplate you can observe that all the items in ListBox will be drawn in a WrapPanel and so they will wrap. But how can I add one text box after the last Item so that user can enter some text and as soon as he press
Enter key,a new ListBoxItem gets created. Actually what I want here is difficult to explain as I cannot attach any image here for better explanation. So please see
TO, CC and BCC text boxes in Yahoo or Hotmail email account.
I also want to add something here. When I tried with following changes, I got an exception. The exception is that since WrapPanel is being filled dynamically (as ListBox has been bind with xml nodes as I did explain in previous post), you cannot add anything (like I am adding a TextBox here) statically.
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel>
<TextBox Text="Default Text" />
</WrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
Please help me.
Regards
Aseem.