TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tarek K
NA
3
0
closing a node in a stackpanel
Sep 8 2008 11:01 AM
I have this project where I have a stackpanel with control elements, each control element has a property called MyNextNode which contains the next object in the chain. My problem occurs when I try to close one of the nodes in this chain. I get the error "Value does not fall within the expected range." here is my code. WFElement orignextnode = this.NextNode this.PrevNode.NextNode = orignexnode Next node is a dependency property that triggers this code when changed protected static void OnNextNodeValueChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { WFElement wfe = o as WFElement; WFElement newElem = null; if (e.NewValue != null) { newElem = e.NewValue as WFElement; wfe.MyNextNode.Content = newElem; } else { wfe.MyNextNode.Content = null; } if (e.OldValue != null && newElem != null) { newElem.NextNode = e.OldValue as WFElement; } } I get that error on {wfe.MyNextNode.Content = newElem;}. If I change the second line to this.PrevNode.NextNode = null; it works however, if there are elements after the deleted element, they get deleted as well. Thank you in advance
Reply
Answers (
0
)
how to find the To field of an email
Error FAX using FAXCOMLib