Re: Enumerating children of a type
It all feels a bit backward to me as to why a parent object would want knowledge of things in it... seems to break encapsulation or some other software rule and does't feel right. If I find myself in this situation, I try to build custom controls at the lower level that have explicit knowledge of the required elements using Template parts etc. then use databinding to pass around stuff. JK On Fri, Apr 20, 2012 at 11:17 AM, David Burela wrote: > The first reply answered exactly what you require. > > But since we are on the topic, here is another linq extension that may be > useful. > If you have your own custom hierarchy of classes you > (parent/child/child/child) you can specify how the tree is linked to each > object and do depth & breadth first searches on it > > > http://www.claassen.net/geek/blog/2009/06/searching-tree-of-objects-with-linq.html > > > -David Burela > > > On 20 April 2012 10:30, wrote: > >> Yep; same here. >> >> ** ** >> >> Carl. >> >> ** ** >> >> *From:* ozsilverlig ht-boun...@ozsilverlight.com [mailto: >> ozsilverlight-boun...@ozsilverlight.com] *On Behalf Of *Stephen Price < >> step...@perthprojects.com> >> *Sent:* Thursday, 19 April 2012 6:25 PM >> *To:* ozSilverlight >> *Subject:* Re: Enumerating children of a type >> >> ** ** >> >> Quite common to use an extension method similar to the one shown on this >> thread... >> >> ** ** >> >> http://forums.silverlight.net/t/106379.aspx >> >> ** ** >> >> We use something very close to it on the project where I am. >> >> ** ** >> >> On Thu, Apr 19, 2012 at 4:26 PM, Greg Keogh wrote: >> >> I find I’m often enumerating down the visual tree looking for child >> controls of a certain type. Is there an elegant and reliable way of coding >> this that people prefer? -- Greg >> >> >> ___ >> ozsilverlight mailing list >> ozsilverlight@ozsilverlight.com >> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight >> >> ** ** >> >> >> __ >> This email has been scanned by the Symantec Email Security.cloud ser vice. >> For more information please visit http://www.symanteccloud.com >> __ >> >> ___ >> ozsilverlight mailing list >> ozsilverlight@ozsilverlight.com >> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight >> >> ___ >> >> >> This email has been scanned by the Bankwest Email Security System. >> ___ >> >> >> >> >> ___ >> Unencrypted electronic mail is not secure and may not be authentic. >> If you have any doubts as to the contents please telephone to confirm. >> >> This electronic transmission including any attachments is intended only >> for those to whom it is addressed. It may contain copyright material or >> information that is confidential, privileged or exempt from disclosure by >> law. >> Any claim to privilege is not waived or lost by reason of mistaken >> transmission >> of this information. If you are not the intended recipient you must not >> distribute or copy this transmission and should please notify the sender. >> Your costs for doing this will be reimbursed by the sender. >> >> We do not accept liability in connection with computer virus, data >> corruption, >> delay, interruption, unauthorised access or unauthorised amendment. >> >> ___ >> __ >> This email has been scanned by the Symantec Email Security.cloud service. >> For more information please visit http://www.symanteccloud.com >> __ >> >> ___ >> ozsilverlight mailing list >> ozsilverlight@ozsilverlight.com >> http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight >> >> > > ___ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
Re: Enumerating children of a type
The first reply answered exactly what you require. But since we are on the topic, here is another linq extension that may be useful. If you have your own custom hierarchy of classes you (parent/child/child/child) you can specify how the tree is linked to each object and do depth & breadth first searches on it http://www.claassen.net/geek/blog/2009/06/searching-tree-of-objects-with-linq.html -David Burela On 20 April 2012 10:30, wrote: > Yep; same here. > > ** ** > > Carl. > > ** ** > > *From:* ozsilverlig ht-boun...@ozsilverlight.com [mailto: > ozsilverlight-boun...@ozsilverlight.com] *On Behalf Of *Stephen Price < > step...@perthprojects.com> > *Sent:* Thursday, 19 April 2012 6:25 PM > *To:* ozSilverlight > *Subject:* Re: Enumerating children of a type > > ** ** > > Quite common to use an extension method similar to the one shown on this > thread... > > ** ** > > http://forums.silverlight.net/t/106379.aspx > > ** ** > > We use something very close to it on the project where I am. > > ** ** > > On Thu, Apr 19, 2012 at 4:26 PM, Greg Keogh wrote: > > I find I’m often enumerating down the visual tree looking for child > controls of a certain type. Is there an elegant and reliable way of coding > this that people prefer? -- Greg > > > ___ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > ** ** > > > __ > This email has been scanned by the Symantec Email Security.cloud ser vice. > For more information please visit http://www.symanteccloud.com > __ > > ___ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > ___ > > > This email has been scanned by the Bankwest Email Security System. > ___ > > > > > ___ > Unencrypted electronic mail is not secure and may not be authentic. > If you have any doubts as to the contents please telephone to confirm. > > This electronic transmission including any attachments is intended only > for those to whom it is addressed. It may contain copyright material or > information that is confidential, privileged or exempt from disclosure by > law. > Any claim to privilege is not waived or lost by reason of mistaken > transmission > of this information. If you are not the intended recipient you must not > distribute or copy this transmission and should please notify the sender. > Your costs for doing this will be reimbursed by the sender. > > We do not accept liability in connection with computer virus, data > corruption, > delay, interruption, unauthorised access or unauthorised amendment. > > ___ > __ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com > __ > > ___ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
RE: Enumerating children of a type
Yep; same here. Carl. From: ozsilverlight-boun...@ozsilverlight.com [mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Stephen Price Sent: Thursday, 19 April 2012 6:25 PM To: ozSilverlight Subject: Re: Enumerating children of a type Quite common to use an extension method similar to the one shown on this thread... http://forums.silverlight.net/t/106379.aspx We use something very close to it on the project where I am. On Thu, Apr 19, 2012 at 4:26 PM, Greg Keogh wrote: I find I'm often enumerating down the visual tree looking for child controls of a certain type. Is there an elegant and reliable way of coding this that people prefer? -- Greg ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight __ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com __ ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight ___ This email has been scanned by the Bankwest Email Security System. ___ ___ Unencrypted electronic mail is not secure and may not be authentic. If you have any doubts as to the contents please telephone to confirm. This electronic transmission including any attachments is intended only for those to whom it is addressed. It may contain copyright material or information that is confidential, privileged or exempt from disclosure by law. Any claim to privilege is not waived or lost by reason of mistaken transmission of this information. If you are not the intended recipient you must not distribute or copy this transmission and should please notify the sender. Your costs for doing this will be reimbursed by the sender. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. ___ __ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com _ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
Re: Enumerating children of a type
Quite common to use an extension method similar to the one shown on this thread... http://forums.silverlight.net/t/106379.aspx We use something very close to it on the project where I am. On Thu, Apr 19, 2012 at 4:26 PM, Greg Keogh wrote: > I find I’m often enumerating down the visual tree looking for child > controls of a certain type. Is there an elegant and reliable way of coding > this that people prefer? -- Greg > > ___ > ozsilverlight mailing list > ozsilverlight@ozsilverlight.com > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
Enumerating children of a type
I find I'm often enumerating down the visual tree looking for child controls of a certain type. Is there an elegant and reliable way of coding this that people prefer? -- Greg ___ ozsilverlight mailing list ozsilverlight@ozsilverlight.com http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight