Click here to Skip to main content
15,895,667 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: VS 2008 Pin
Amit Rai Sharma7-Aug-09 0:21
Amit Rai Sharma7-Aug-09 0:21 
GeneralRe: VS 2008 Pin
arkiboys7-Aug-09 6:10
arkiboys7-Aug-09 6:10 
Questionhow to set relative image path of image source from style Pin
salon5-Aug-09 4:25
salon5-Aug-09 4:25 
AnswerRe: how to set relative image path of image source from style Pin
Mark Salsbery5-Aug-09 6:09
Mark Salsbery5-Aug-09 6:09 
AnswerRe: how to set relative image path of image source from style Pin
Michael Sync6-Aug-09 6:24
Michael Sync6-Aug-09 6:24 
QuestionHow to get the description of an item in RSS feeds Pin
Nekkantidivya5-Aug-09 3:10
Nekkantidivya5-Aug-09 3:10 
AnswerRe: How to get the description of an item in RSS feeds Pin
Michael Sync6-Aug-09 7:49
Michael Sync6-Aug-09 7:49 
QuestionBinding Listbox to list of object Pin
sunit_825-Aug-09 3:00
sunit_825-Aug-09 3:00 
Below is the code page:
public partial class DataBinding : UserControl
    {
        public DataBinding()
        {
            InitializeComponent();

            List<PlaylistItem> lstPLI = new List<PlaylistItem>();
            for (int i = 0; i < 3; i++)
            {
                lstPLI.Add(new PlaylistItem("Name" + i.ToString(), "Path" + i.ToString()));

            }
            lstPlayList.ItemsSource = lstPLI;
        }
    }

    public class PlaylistItem
    {
        public string FileName;
        public string FilePath;

        public PlaylistItem()
        {

        }
        public PlaylistItem(string filename,string filepath)
        {
            FileName = filename;
            FilePath = filepath;
        }
    }



And here is the xaml page:
<UserControl x:Class="FirstSilverLight.DataBinding"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
        <ListBox x:Name="lstPlayList">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding FileName}"></TextBlock>
                        <TextBlock Text="{Binding FilePath}"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>


The Listbox doesnot show any items in it when I run this, though Listbox items.count is 3 when i debug this. Any idea what the problem is?

s.a.w.

AnswerRe: Binding Listbox to list of object Pin
Mark Salsbery5-Aug-09 6:22
Mark Salsbery5-Aug-09 6:22 
GeneralRe: Binding Listbox to list of object Pin
sunit_825-Aug-09 19:16
sunit_825-Aug-09 19:16 
GeneralRe: Binding Listbox to list of object Pin
Mark Salsbery6-Aug-09 6:46
Mark Salsbery6-Aug-09 6:46 
AnswerRe: Binding Listbox to list of object Pin
nizam babu30-Aug-09 22:43
nizam babu30-Aug-09 22:43 
QuestionSimple custom Control Question Pin
ErickTreeTops4-Aug-09 21:04
ErickTreeTops4-Aug-09 21:04 
AnswerRe: Simple custom Control Question Pin
#realJSOP4-Aug-09 22:45
mve#realJSOP4-Aug-09 22:45 
AnswerRe: Simple custom Control Question Pin
Mark Salsbery5-Aug-09 9:36
Mark Salsbery5-Aug-09 9:36 
QuestionWindows vista MenuItem Pin
yanairon4-Aug-09 3:47
yanairon4-Aug-09 3:47 
AnswerRe: Windows vista MenuItem Pin
Super Lloyd6-Aug-09 1:54
Super Lloyd6-Aug-09 1:54 
GeneralRe: Windows vista MenuItem Pin
yanairon9-Aug-09 1:15
yanairon9-Aug-09 1:15 
GeneralRe: Windows vista MenuItem Pin
Super Lloyd9-Aug-09 1:45
Super Lloyd9-Aug-09 1:45 
GeneralRe: Windows vista MenuItem Pin
yanairon9-Aug-09 3:21
yanairon9-Aug-09 3:21 
QuestionSlow WPF performance. Please Help Pin
Etienne_1234-Aug-09 0:56
Etienne_1234-Aug-09 0:56 
AnswerRe: Slow WPF performance. Please Help Pin
#realJSOP4-Aug-09 1:06
mve#realJSOP4-Aug-09 1:06 
GeneralRe: Slow WPF performance. Please Help Pin
Etienne_1235-Aug-09 2:32
Etienne_1235-Aug-09 2:32 
QuestionLINQ Pin
sunil.n.cs4-Aug-09 0:44
sunil.n.cs4-Aug-09 0:44 
AnswerRe: LINQ Pin
Michael Sync4-Aug-09 1:27
Michael Sync4-Aug-09 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.