Click here to Skip to main content
15,889,281 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 4:45
mvePete O'Hanlon8-Aug-11 4:45 
GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:13
Narender Singh Thakur8-Aug-11 5:13 
GeneralRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 5:22
mvePete O'Hanlon8-Aug-11 5:22 
GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:24
Narender Singh Thakur8-Aug-11 5:24 
QuestionUpdate TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 4:05
Mc_Topaz8-Aug-11 4:05 
AnswerRe: Update TreeView's ItemsSource during runtime Pin
Pete O'Hanlon8-Aug-11 4:26
mvePete O'Hanlon8-Aug-11 4:26 
GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 5:02
Mc_Topaz8-Aug-11 5:02 
GeneralRe: Update TreeView's ItemsSource during runtime [modified] Pin
SledgeHammer018-Aug-11 6:17
SledgeHammer018-Aug-11 6:17 
Ok, a few clarifications:

1) in your original post you did something like:

treeView.ItemsSource = blah;

and then tried to do:

treeView.ItemsSource = blah;

again later. Not sure if that is a typo or not, but you can't reassign the same list like that because ItemsSource is a dependency property, so the tree view will only respond to CHANGE notifications.

You could do:

treeView.ItemsSource = blah;
treeView.ItemsSource = null;
treeView.ItemsSource = blah;

and it will work, but that is not the right solution.

Pete's response for you to switch over to an ObservableCollection wasn't a great response (and it was incomplete) because as you saw, it took a lot of code changes on your part. It would have been easier to switch you over to ObservableDictionary. This is not part of .NET (yet), but it was published on Dr. WPF's blog several years ago. It is WIDELY used.

2) Switching you over to an observable collection class was only half the solution. That will allow the tree to respond to your adding and removing items, but not changing items themselves. For that, your item class needs to implement INotifyPropertyChanged.

modified on Monday, August 8, 2011 12:40 PM

GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 21:54
Mc_Topaz8-Aug-11 21:54 
Questioncolumns are empty Pin
picasso26-Aug-11 11:18
picasso26-Aug-11 11:18 
QuestionService Model Pin
mehrdadc486-Aug-11 2:17
mehrdadc486-Aug-11 2:17 
AnswerRe: Service Model Pin
Mycroft Holmes6-Aug-11 2:50
professionalMycroft Holmes6-Aug-11 2:50 
AnswerRe: Service Model Pin
Simon Bang Terkildsen8-Aug-11 1:05
Simon Bang Terkildsen8-Aug-11 1:05 
GeneralRe: Service Model Pin
Mycroft Holmes8-Aug-11 1:31
professionalMycroft Holmes8-Aug-11 1:31 
GeneralRe: Service Model Pin
Simon Bang Terkildsen8-Aug-11 1:46
Simon Bang Terkildsen8-Aug-11 1:46 
QuestionSilverlight and SmartCards Pin
#realJSOP6-Aug-11 1:59
mve#realJSOP6-Aug-11 1:59 
AnswerRe: Silverlight and SmartCards Pin
Mycroft Holmes6-Aug-11 2:47
professionalMycroft Holmes6-Aug-11 2:47 
QuestionBuild TreeViewItem dynamically [modified] Pin
McCombi5-Aug-11 1:19
McCombi5-Aug-11 1:19 
AnswerRe: Build TreeViewItem dynamically Pin
SledgeHammer015-Aug-11 4:57
SledgeHammer015-Aug-11 4:57 
GeneralRe: Build TreeViewItem dynamically Pin
McCombi7-Aug-11 22:29
McCombi7-Aug-11 22:29 
AnswerRe: Build TreeViewItem dynamically Pin
Mycroft Holmes5-Aug-11 18:09
professionalMycroft Holmes5-Aug-11 18:09 
AnswerRe: Build TreeViewItem dynamically Pin
McCombi7-Aug-11 22:43
McCombi7-Aug-11 22:43 
AnswerRe: Build TreeViewItem dynamically Pin
McCombi31-Aug-11 2:39
McCombi31-Aug-11 2:39 
QuestionWindows Phone 7, buttons and events when moving your finger Pin
Sir TK4-Aug-11 22:50
Sir TK4-Aug-11 22:50 
Questiondatabinding in wpf Pin
GLolita4-Aug-11 15:57
GLolita4-Aug-11 15:57 

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.