<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/213619.aspx</link><pubDate>Wed, 29 Apr 2009 14:37:52 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:213619</guid><dc:creator>InquisitorJax</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/213619.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=213619</wfw:commentRss><description>&lt;p&gt;I just wanted to throw my 2 cents in here for the MS guys that may be reading this.&lt;/p&gt;&lt;p&gt;It would be gr8 if there was a &amp;quot;GetBinding&amp;quot; counterpart in SL3.&lt;/p&gt;&lt;p&gt;I have a scenario (not all that uncommon I would think) where I need to map a user action (like double-click) to business logic. In order to do this, I need to know what property of the control&amp;#39;s dataContext is bound to the control.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Re: Re: Re: Re: Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/69623.aspx</link><pubDate>Wed, 09 Jul 2008 12:06:08 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:69623</guid><dc:creator>WJamesLord</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/69623.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=69623</wfw:commentRss><description>&lt;p&gt;Thanks, Yi-Lun.&amp;nbsp; That&amp;#39;s a useful tidbit on binding.&amp;nbsp; I&amp;#39;ll file it away for future development.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Re: Re: Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/69045.aspx</link><pubDate>Tue, 08 Jul 2008 03:59:19 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:69045</guid><dc:creator>Yi-Lun Luo - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/69045.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=69045</wfw:commentRss><description>&lt;p&gt;Well, just create a binding without a path:&lt;/p&gt;
&lt;p&gt;{Binding Converter={StaticResource yourConverter}}&lt;/p&gt;
&lt;p&gt;For GetBinding, it does exist in WPF, but unfortunately it&amp;#39;s unlikely to be supported in Silverlight 2... Maybe in the future, I can&amp;#39;t promise you...&lt;/p&gt;</description></item><item><title>Re: Re: Re: Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/68957.aspx</link><pubDate>Mon, 07 Jul 2008 20:38:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:68957</guid><dc:creator>WJamesLord</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/68957.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=68957</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m binding the content section of a&amp;nbsp;XAML to an&amp;nbsp;object constructed from a&amp;nbsp;dynamically-created type.&amp;nbsp; The type is generated by a data serializer that I use to transport values to/from web services.&amp;nbsp; Each bound control in the content&amp;nbsp;section is linked to one property in the type.&amp;nbsp; The bindings are defined in the XAML in a typical fashion.&amp;nbsp; So far pretty straight forward stuff.&lt;/p&gt;
&lt;p&gt;Now the fun.&amp;nbsp; I need to cross-reference the bound controls with meta-data stored in the serializer.&amp;nbsp; There is separate meta-data for each property stored in the data object.&amp;nbsp; However, when binding to the Text property of a TextBox (or a similar such property for other controls), a custom IValueConverter only provides the binding value and type.&amp;nbsp; It doesn&amp;#39;t provide the&amp;nbsp;affected control or the related&amp;nbsp;bound data object or the related property in the bound data&amp;nbsp;object.&amp;nbsp; So as it stands, a IValueConverter doesn&amp;#39;t really meet my needs...&amp;nbsp; when used as a XAML-driven converter.&lt;/p&gt;
&lt;p&gt;However, by moving the data binding and custom converters out of the XAML and into the code behind, I can then pass a &amp;quot;binding details&amp;quot; object as a parameter to each Binding.&amp;nbsp; This provides the necessary information and solves my issues.&lt;/p&gt;
&lt;p&gt;While my solution works, I would have prefered to leave the bindings in the XAML and then reference a &amp;quot;GetBinding&amp;quot; method for each bound control to access the binding information.&amp;nbsp; Unfortunately, there is currently only a SetBinding method.&amp;nbsp; Perhaps in the future, its counterpart will be added.&amp;nbsp; For now, my bass ackwards approach will have to do.&lt;/p&gt;
&lt;p&gt;Thanks to everyone for any replies to my posting.&lt;/p&gt;
&lt;p&gt;W James&lt;/p&gt;
&lt;p&gt;P.S. Yi-Lun, in your example, I see that you reference the value parameter as a class.&amp;nbsp; In my bindings, the value is always presented as a single property from the parent class.&amp;nbsp; Please explain how the value may be passed as a class.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/68673.aspx</link><pubDate>Mon, 07 Jul 2008 04:53:40 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:68673</guid><dc:creator>Yi-Lun Luo - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/68673.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=68673</wfw:commentRss><description>&amp;nbsp; 
&lt;p&gt;Hello, I don&amp;#39;t quite understand your scenario. Can you give a sample? If you want to modify some properties of Controls based on the binding source, I think you can just use value converters. For example, bind a Grid&amp;#39;s Background to a person&amp;#39;s age:&lt;/p&gt;
&lt;p&gt;public object Convert(object value, Type targetType, object parameter, CultureInfo culture)&lt;br /&gt;{&lt;br /&gt;Person person = (Person)value;&lt;br /&gt;if(person.Age &amp;gt; 20) &lt;br /&gt;{&lt;br /&gt;return new SolidColorBrush(Colors.Blue);&lt;br /&gt;}&lt;br /&gt;return new SolidColorBrush(Colors.Red);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;If you want to validate the user input, you should rather do the validation on the data source, in the set methods, which is more secure.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/68425.aspx</link><pubDate>Sat, 05 Jul 2008 15:38:55 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:68425</guid><dc:creator>WJamesLord</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/68425.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=68425</wfw:commentRss><description>&lt;p&gt;Thanks for the URLs, Ken.&amp;nbsp; IValueConverters are a good feature.&amp;nbsp; I use them quite a bit.&amp;nbsp; However, the interface doesn&amp;#39;t provide the means to reference these source property in the bound data object, which is really what I need.&amp;nbsp; They are really meant for formatting, handling exceptions, and other special case scenarios.&lt;/p&gt;
&lt;p&gt;The scenario that I need to address is slightly different.&amp;nbsp; At bind time, I want to apply certain attributes to a control based upon meta-data stored in my custom data object that I use to serialize/deserialize values to/from service providers and Silverlight client apps.&amp;nbsp; The IValueConverter interface does not provide direct access to the binding control not does it describe the property in the underlying data object to which a control is being bound.&lt;/p&gt;
&lt;p&gt;I did find a &amp;quot;solution&amp;quot; to this scenario.&amp;nbsp; Actually, a better word would be &amp;quot;hack&amp;quot;.&amp;nbsp; It hestitate to describe it - it&amp;#39;s that ugly.&amp;nbsp; It does work, but I&amp;#39;m really hoping that someone provides a cleaner solution.&amp;nbsp; Until then, it will have to do.&lt;/p&gt;
&lt;p&gt;W James&lt;/p&gt;</description></item><item><title>Re: Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/68271.aspx</link><pubDate>Fri, 04 Jul 2008 17:08:47 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:68271</guid><dc:creator>Ken Tucker</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/68271.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=68271</wfw:commentRss><description>&lt;p&gt;To format the output in silverlight you need to use a class that inherits from IValueconverter&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/delay/archive/2008/05/04/ivalueconverter-the-swiss-army-knife-of-bindings-propertyviewer-sample-is-a-wpf-silverlight-visualization-and-debugging-aid.aspx"&gt;http://blogs.msdn.com/delay/archive/2008/05/04/ivalueconverter-the-swiss-army-knife-of-bindings-propertyviewer-sample-is-a-wpf-silverlight-visualization-and-debugging-aid.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/tamir/archive/2008/06/19/quick-silverlight-tip-how-to-set-format-and-validate-value-in-textbox.aspx"&gt;http://blogs.microsoft.co.il/blogs/tamir/archive/2008/06/19/quick-silverlight-tip-how-to-set-format-and-validate-value-in-textbox.aspx&lt;/a&gt;</description></item><item><title>Are Data Binding Details Accessible in Beta 2?</title><link>http://forums.silverlight.net/forums/thread/68228.aspx</link><pubDate>Fri, 04 Jul 2008 14:32:13 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:68228</guid><dc:creator>WJamesLord</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/68228.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=68228</wfw:commentRss><description>&lt;p&gt;As in Beta1, the only data binding&amp;nbsp;information that I see exposed in Beta2 is the DataContext property for any control.&amp;nbsp; While this provides the&amp;nbsp;object that was bound to a control, it does provide the&amp;nbsp;property.&amp;nbsp; Unfortunately, I need the property to cross-reference some meta-data that I intend to utilize to&amp;nbsp;&amp;quot;bind&amp;quot;&amp;nbsp;each bound&amp;nbsp;control to enforce contraints such as maximum length and input format.&lt;/p&gt;
&lt;p&gt;Does anyone know if there is a way to access the Binding object used for any control?&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;W James&lt;/p&gt;</description></item></channel></rss>