Click here to Skip to main content
15,916,693 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to read data from databinding controls(listbox in my code) [modified] Pin
Rocky2313-Apr-11 23:51
Rocky2313-Apr-11 23:51 
AnswerRe: How to read data from databinding controls(listbox in my code) Pin
Tarun.K.S14-Apr-11 0:07
Tarun.K.S14-Apr-11 0:07 
QuestionMoving multiple Shapes in Canvas Pin
Member 773700213-Apr-11 22:15
Member 773700213-Apr-11 22:15 
AnswerRe: Moving multiple Shapes in Canvas Pin
SledgeHammer0114-Apr-11 6:33
SledgeHammer0114-Apr-11 6:33 
GeneralRe: Moving multiple Shapes in Canvas Pin
Member 773700215-Apr-11 10:00
Member 773700215-Apr-11 10:00 
QuestionThe problem with listview and timer [modified] Pin
Tesic Goran13-Apr-11 19:33
professionalTesic Goran13-Apr-11 19:33 
QuestionWPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy13-Apr-11 18:52
devvvy13-Apr-11 18:52 
AnswerRe: WPF virtualizingstackpanel vs Grid or StackPanel [modified] Pin
Tarun.K.S13-Apr-11 21:18
Tarun.K.S13-Apr-11 21:18 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0114-Apr-11 6:24
SledgeHammer0114-Apr-11 6:24 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S14-Apr-11 21:16
Tarun.K.S14-Apr-11 21:16 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Pete O'Hanlon14-Apr-11 22:47
mvePete O'Hanlon14-Apr-11 22:47 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S14-Apr-11 23:47
Tarun.K.S14-Apr-11 23:47 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Pete O'Hanlon15-Apr-11 0:03
mvePete O'Hanlon15-Apr-11 0:03 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 0:17
Tarun.K.S15-Apr-11 0:17 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0115-Apr-11 4:36
SledgeHammer0115-Apr-11 4:36 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 7:25
Tarun.K.S15-Apr-11 7:25 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0115-Apr-11 7:50
SledgeHammer0115-Apr-11 7:50 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S16-Apr-11 8:41
Tarun.K.S16-Apr-11 8:41 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy14-Apr-11 23:10
devvvy14-Apr-11 23:10 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 0:00
Tarun.K.S15-Apr-11 0:00 
AnswerRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0114-Apr-11 6:26
SledgeHammer0114-Apr-11 6:26 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy14-Apr-11 23:04
devvvy14-Apr-11 23:04 
QuestionHow to add the data from text box to already created list data item source Pin
Rocky2313-Apr-11 4:09
Rocky2313-Apr-11 4:09 
AnswerRe: How to add the data from text box to already created list data item source [modified] Pin
Tarun.K.S13-Apr-11 4:57
Tarun.K.S13-Apr-11 4:57 
I would recommend you to use ObservableCollection instead of List because the former can notify you whenever your collection changes.

C#
private ObservableCollection<Directive> list;

void DerivedAttributePanel_Loaded(object sender,RoutedEventArgs e)
        {              
            list = new ObservableCollection<Directive>();
            list.Add(new Directive { DirectiveName = "Filter1", Description = "Description 1" });
            list.Add(new Directive { DirectiveName = "Filter2", Description = "Description 2" });
            list.Add(new Directive { DirectiveName = "Filter3", Description = "Description 3" });
           
            lbDirectiveList.ItemsSource = list;
         }

//Suppose you have a Button to add data
// No need of setting the ItemsSource again!
private void AddData_Click(object sender, RoutedEventArgs e)
{
 Directive newDirect = new Directive { DiretiveName = txtFilter.Text, Description = txtDesc.Text };
 list.Add(newDirect);
}


People with high attitude deserve the standing ovation of our highest finger!

My Blog![^]
modified on Wednesday, April 13, 2011 1:41 PM

GeneralRe: How to add the data from text box to already created list data item source Pin
Rocky2313-Apr-11 5:32
Rocky2313-Apr-11 5:32 

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.