<?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>Re: Nullable(Of T) Dependency Property Issues</title><link>http://forums.silverlight.net/forums/thread/253228.aspx</link><pubDate>Mon, 20 Jul 2009 04:20:06 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:253228</guid><dc:creator>StefanOlson</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/253228.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=253228</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/silverlight/images/icon-quote.gif"&gt; &lt;strong&gt;Yi-Lun Luo - MSFT:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Unfortunately XAML doesn&amp;#39;t support Nullable types because they&amp;#39;re generic types...&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Strictly speaking, it&amp;#39;s Silverlight that doesn&amp;#39;t support these types because the xaml in WPF does in fact support&amp;nbsp;nullable types.&amp;nbsp; The fact that Silverlight doesn&amp;#39;t support them&amp;nbsp;is frustrating.&lt;/p&gt;
&lt;p&gt;...Stefan&lt;/p&gt;</description></item><item><title>Re: Nullable(Of T) Dependency Property Issues</title><link>http://forums.silverlight.net/forums/thread/98905.aspx</link><pubDate>Mon, 29 Sep 2008 05:27:15 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:98905</guid><dc:creator>Yi-Lun Luo - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/98905.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=98905</wfw:commentRss><description>&lt;p&gt;Unfortunately XAML doesn&amp;#39;t support Nullable types because they&amp;#39;re generic types...&lt;/p&gt;</description></item><item><title>Nullable(Of T) Dependency Property Issues</title><link>http://forums.silverlight.net/forums/thread/97122.aspx</link><pubDate>Thu, 25 Sep 2008 19:18:57 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:97122</guid><dc:creator>wjchristenson2</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/97122.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=97122</wfw:commentRss><description>&lt;p&gt;I am trying to create dependency properties that utilize the Nullubale(Of T) structure.&amp;nbsp;&amp;nbsp;When I set the property in XAML, I get parser exceptions.&lt;/p&gt;
&lt;p&gt;For instance, I have a user control and I may or may not want to set its color.&amp;nbsp; If I don&amp;#39;t set its color, I want t auto-color it using a predefined color.&amp;nbsp; This would be easy using the Nullable(Of T) structure because I could simply do a test on the property like so: Me.Color.HasValue.&amp;nbsp; I&amp;#39;ve tried explicitly defining a type converter attribute on my properties to no avail.&amp;nbsp; Any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;    &lt;span class="kwd"&gt;Public Shared ReadOnly&lt;/span&gt; ColorProperty &lt;span class="kwd"&gt;As&lt;/span&gt; DependencyProperty = DependencyProperty.Register(&lt;span class="st"&gt;&amp;quot;Color&amp;quot;&lt;/span&gt;, &lt;span class="kwd"&gt;GetType&lt;/span&gt;(Nullable(Of Color)), &lt;span class="kwd"&gt;GetType&lt;/span&gt;(Series), &lt;span class="kwd"&gt;Nothing&lt;/span&gt;)

    &amp;lt;ComponentModel.TypeConverterAttribute(&lt;span class="kwd"&gt;GetType&lt;/span&gt;(Nullable(Of Color)))&amp;gt; _
    &lt;span class="kwd"&gt;Public Property&lt;/span&gt; Color() &lt;span class="kwd"&gt;As&lt;/span&gt; Nullable(Of Color)
        &lt;span class="kwd"&gt;Get
            Return CType&lt;/span&gt;(GetValue(Series.ColorProperty), Nullable(Of Color))
        &lt;span class="kwd"&gt;End Get
        Set&lt;/span&gt;(&lt;span class="kwd"&gt;ByVal&lt;/span&gt; value &lt;span class="kwd"&gt;As&lt;/span&gt; Nullable(Of Color))
            SetValue(Series.ColorProperty, value)
        &lt;span class="kwd"&gt;End Set
    End Property&lt;/span&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>