Monday 15 August 2011

c# - WPF Chat List Box - With user Image display -


Hello there I am working on a WPF chat application, I would like to save user images in the database and I would like to load Each user has his picture in his friends list box and here is my current code but I do not know how it will start.

  Private Zero LoadFriday (Client State Client) {foreach (Client.Strackers.Compaint friend to client.friend friend) {friends_listBox.Items.Add (friend.Name) ; FriendsCount ++; }}   

I know how to add an item to a list box with XML code:

  & lt; ListBoxItem background = "LightCoral" Foreground = "Red" FontFamily = "WordPress" Font Sources = "12" fontweit = "bold" & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Image Source = "/ my_App; Component / Img." "Height =" 30 "& gt; & Lt; / Image & gt; & Lt; Textbox text = "coffee" & gt; & Lt; / TextBlock & gt; & Lt; / StackPanel & gt; & Lt; / ListBoxItem & gt;   

But I do not know how to do this with the C # code ...

How do I store database users in a database ??

Any ideas about this?

I really think that you should spend some time for the first time so that you basically learn in WPF Drag it. There are many aspects in one app.

^ ^ Whatever I have said in my comments on your question, I have not chosen the basis of this sample on MVVM cos Use the sample as an idea only and see if you have done this before in MVVM)

Try to see if you can first understand the sample before dealing with the database and if Do not receive and read any book on WPF In Uru. Actually can not be any more fundamental than this.

In the sample,

friends.cs addition to the implementation of INPC as you are posted.

Main window. should show how ListBox.ItemTemplate contains a DataTemplate and is set to bind datacontax

Properties in the MainWindow.XML CS should be displayed in the Friends list collection and should also show the datavid to The main window is set to .

If you are comfortable with this (and perhaps Style more resources), you might think that friends list < / P>

How to use DB to populate the source of. Look at that level or the previous questions like

No comments:

Post a Comment