DataTemplate in ListBox

Posted by Anu on Stack Overflow See other posts from Stack Overflow or by Anu
Published on 2010-03-12T06:14:07Z Indexed on 2010/03/12 6:17 UTC
Read the original article Hit count: 453

Filed under:
|
|

Hi, I have tabcontrol,in that by pressing second tab button im adding data to third Tab Listbox.But its not get added. SecondTab function:

private void Callbutton_Click(object sender, RoutedEventArgs e)
        { 
            tab.AddPresetmenu("CALL BUTTON");        
        }

ThirdTab Fucntion:

ObservableCollection<DataItem> items = new ObservableCollection<DataItem>();
public  void AddPresetmenu(string pMenu)
        { 
            items.Add(new DataItem(pMenu));
            menubox.ItemsSource = items;
        }

Third Tab ListBox XAML:

<ListBox x:Name="menubox" Margin="0,5,0,0" Height="244" Width="240" Background="Silver" BorderThickness="0">   
 </ListBox>

I think Im missing something.Please Help me.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about listbox