<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Verification, SLtoolkit-Dataform and the good old FormatException</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Verification, SLtoolkit-Dataform and the good old FormatException</description>
  <pubDate>Wed, 29 Jul 2026 21:27:09 -700</pubDate>
  <lastBuildDate>Mon, 23 May 2011 12:22:35 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2648</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException :  Regarding the INotifyDataErrorInfo.ErrorsChanged...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10794#10794</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 23-May-2011 at 12:22pm<br /><br /><table width="99%"><tr><td class="BBquote"><div><br></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">Regarding the INotifyDataErrorInfo.ErrorsChanged event, that might or might not be a bug. I was able to reproduce the issue here and what I'm seeing is that any kind of property change whether it results in an error or not, will trigger the ErrorsChanged event. This sound incorrect but I will confirm and get back to you as soon as possible.</span></div><div><br></div><div></td></tr></table></div><div><br></div><div>I've submitted a bug report on this. Please reply to this topic should anyone think that this needs to be fixed immediately. Thank you.</div>]]>
   </description>
   <pubDate>Mon, 23 May 2011 12:22:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10794#10794</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Your welcome. Thank you for your...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10718#10718</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 17-May-2011 at 11:16am<br /><br />Your welcome. Thank you for your vote. We're always improving our code samples and this is already on our ToDo list to add.<div><br></div><div>And in case you haven't noticed, we have a new forum section called <a href="http://www.ideablade.com/forum/forum_topics.asp?FID=49&amp;title=community-feedback" target="_blank">Community Feedback</a> where you can give, as the name says, feedbacks :)</div>]]>
   </description>
   <pubDate>Tue, 17 May 2011 11:16:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10718#10718</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Thank you very much for this guidance!I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10711#10711</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 17-May-2011 at 5:27am<br /><br />Thank you very much for this guidance!<div><br></div><div>I would really vote for providing such code samples in the resource center!</div>]]>
   </description>
   <pubDate>Tue, 17 May 2011 05:27:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10711#10711</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : AuerRo;Thanks for the sample....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10673#10673</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 12-May-2011 at 8:27pm<br /><br />AuerRo;<div><br></div><div>Thanks for the sample. Sorry for the misunderstanding. Yes, my code snippet was only to show how to add a custom property and bind that to a TextBox as well as apply a DF validation to it.</div><div><br></div><div>Here's another code snippet that should show how to solve a scenario similar to yours. However, please note that this code snippet is not perfect and could very much be improved depending on your specific needs.</div><div><br></div><div>I'm only going to post the Model part of the code as nothing really changes on the View and the ViewModel. And instead of using an Employee entity, I'm now using an OrderDetail entity with UnitPrice decimal property as an example. I also created a custom verifier to have a cleaner control over the validation.</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><br></div><div><b>Model</b></div><div><br></div><div><div>public partial class OrderDetail : Entity {</div><div><br></div><div>&nbsp; &nbsp; &#091;DataMember&#093;</div><div>&nbsp; &nbsp; public string UnitPriceFormatted {</div><div>&nbsp; &nbsp; &nbsp; get {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return PropertyMetadata.UnitPriceFormatted.GetValue(this);</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; set {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; PropertyMetadata.UnitPriceFormatted.SetValue(this, value);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; bool error = this.EntityAspect.ValidationErrors.Any(vr =&gt; vr.TriggerMemberName ==&nbsp;PropertyMetadata.UnitPriceFormatted.Name);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (!error) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var decimalValue = Convert.ToDecimal(value);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UnitPrice = decimalValue;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; public partial class PropertyMetadata {</div><div>&nbsp; &nbsp; &nbsp; public static readonly DataEntityProperty&lt;OrderDetail, string&gt; UnitPriceFormatted =</div><div>&nbsp; &nbsp; &nbsp; &nbsp; new DataEntityProperty&lt;OrderDetail, string&gt;("UnitPriceFormatted", true, false, ConcurrencyStrategy.None, false, false);</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div><b>DevForce Validation</b></div><div><br></div><div><div>&nbsp; &nbsp; public class VerifierProvider : IVerifierProvider {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; public IEnumerable&lt;Verifier&gt; GetVerifiers(object verifierProviderContext) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; List&lt;Verifier&gt; verifiers = new List&lt;Verifier&gt;();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; verifiers.Add(GetDecimalRangeFormattedVerifier());</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; return verifiers;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div><div>&nbsp; &nbsp; private static Verifier GetDecimalRangeFormattedVerifier() {</div><div>&nbsp; &nbsp; &nbsp; Verifier v = new DecimalRangeFormattedVerifier(typeof(OrderDetail), PropertyMetadata.UnitPriceFormatted.Name);</div><div>&nbsp; &nbsp; &nbsp; v.ErrorMessageInfo.ErrorMessage = "You have entered an invalid decimal number";</div><div><br></div><div>&nbsp; &nbsp; &nbsp; return v;</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div><div>&nbsp; &nbsp; public class DecimalRangeFormattedVerifier : PropertyValueVerifier {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; public DecimalRangeFormattedVerifier(Type pType, String propertyName, String displayName = null,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; bool? shouldTreatEmptyStringAsNull = null)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; : base(new PropertyValueVerifierArgs(pType, propertyName, false, displayName, shouldTreatEmptyStringAsNull)) {</div><div>&nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; public DecimalRangeFormattedVerifier(PropertyValueVerifierArgs args) : base(args) { }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; protected override VerifierResult VerifyValue(object itemToVerify, object valueToVerify,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; TriggerContext triggerContext, VerifierContext verifierContext) {</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; var aString = (string)valueToVerify;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; decimal result;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; var isDecValueOk = Decimal.TryParse(aString, out result);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; VerifierResult vr = new VerifierResult(isDecValueOk);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; return vr;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div></pre></td></tr></table></div>]]>
   </description>
   <pubDate>Thu, 12 May 2011 20:27:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10673#10673</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : I uploaded the sample.Its name...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10655#10655</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 12-May-2011 at 9:13am<br /><br />I uploaded the sample.&nbsp;<div><br></div><div>Its name is "SpotLight.zip".</div><div><br></div><div>Thanks</div>]]>
   </description>
   <pubDate>Thu, 12 May 2011 09:13:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10655#10655</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Hi AuerRo;Please upload your sample...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10642#10642</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 11-May-2011 at 10:25am<br /><br />Hi AuerRo;<div><br></div><div>Please upload your sample here.</div><div><br></div><div><span ="Apple-style-span" style="color: rgb31, 73, 125; "><a href="ftp://www.ideablade.com/DevForce2Support" target="_blank">ftp://www.ideablade.com/DevForce2Support</a></span></div><div><br></div><div>Thanks!</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 11 May 2011 10:25:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10642#10642</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException :  After extensive work on this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10634#10634</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 11-May-2011 at 2:51am<br /><br /><div>After extensive work on this problem I still got no solution.</div><div><br></div><div>Regarding your answer, I tend to say that we do not have the same initial situation.</div><div><br></div><div>In my Entity, there is the computed property "Payment", which is decimal. As a workaround, I created the property PaymentFormatted, which is string. If I try to configure my code like you posted, I get errors because I can't set the Payment in the PaymentFormatted-Setter or the other way in the Getter. And I can't set the Payment-PropertyMetadata, as it is already computed.</div><div><br></div><div>Maybe you just mixed up the names, so I created a completely independent property "PaymentFormatted" (so your solution, just every "Payment" changed to "PaymentFormatted"). Still the same error.</div><div><br></div><div>I even created a new, smaller project, that is easier to oversee, to isolate the problem. But I got the same error. I will upload this sample and send you a message.</div><div><br></div><div>Thanks for your help anyway!</div><div><br></div><div>EDIT:</div><div>@DenisK: It seems that I can't send you a message, your Inbox is full. Could you provide me with your e-mail?</div><span style="font-size:10px"><br /><br />Edited by AuerRo - 11-May-2011 at 3:56am</span>]]>
   </description>
   <pubDate>Wed, 11 May 2011 02:51:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10634#10634</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException :  Hi Roland;Have you made sure...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10601#10601</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 05-May-2011 at 2:25pm<br /><br />Hi Roland;<div><br></div><div>Have you made sure the following,&nbsp;"<span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">NotifyOnValidationError=true",&nbsp;</span>is set on the TextBox? You also shouldn't need to call VerifierEngine.ExecuteBeforeSet in the setter as the validation is automatically handled.&nbsp;</div><div><br></div><div>If that doesn't do the trick, I might have to ask you to upload a small sample solution.</div><div><br></div><div>FYI, I did a quick simple example of this to show how it works.</div><div><br></div><div>Note: Other unnecessary details are not being shown.</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><br></div><div><b>Employee Model</b></div><div><br></div><div>public partial class Employee : Entity {</div><div><br></div><div><div>&nbsp; &nbsp; &#091;DecimalRangeVerifier(MinValue = 0d, MaxValue = 100d)&#093;</div><div>&nbsp; &nbsp; &#091;DataMember&#093;</div><div>&nbsp; &nbsp; public string PaymentFormatted {</div><div>&nbsp; &nbsp; &nbsp; get {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return PropertyMetadata.Payment.GetValue(this);</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; set {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; PropertyMetadata.Payment.SetValue(this, value);</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; public partial class PropertyMetadata {</div><div>&nbsp; &nbsp; &nbsp; public static readonly DataEntityProperty&lt;Employee, string&gt; Payment =</div><div>&nbsp; &nbsp; &nbsp; &nbsp; new DataEntityProperty&lt;Employee, string&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ("PaymentFormatted", true, false, ConcurrencyStrategy.None, false, &nbsp; false);</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div>}</div><div><br></div><div><b>ViewModel</b></div><div><br></div><div><div>&nbsp; &nbsp; _mainMgr.Employees.Take(1).ExecuteAsync(op =&gt; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; AnEmployee = op.Results.Cast&lt;Employee&gt;().FirstOrDefault();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; AnEmployee.PaymentFormatted = "0";</div><div>&nbsp; &nbsp; &nbsp; });</div></div><div><br></div><div><div>&nbsp; &nbsp; public Employee AnEmployee {</div><div>&nbsp; &nbsp; &nbsp; get {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return _anEmployee;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; set {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; _anEmployee = value;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; RaisePropertyChanged("AnEmployee");</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div><b>View (xaml)</b></div><div><br></div><div><div>&lt;StackPanel Grid.Row="3" DataContext="{Binding AnEmployee}"&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;TextBox Name="txtOutput"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Text="{Binding PaymentFormatted, Mode=TwoWay, NotifyOnValidationError=True,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FallbackValue='Binding has failed'}"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Height="25" Width="150"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;VerticalScrollBarVisibility="Auto" /&gt;</div></div><div><br></div><div>&lt;/StackPanel&gt;</div><div><br></div><div></pre></td></tr></table></div>]]>
   </description>
   <pubDate>Thu, 05 May 2011 14:25:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10601#10601</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Thanks for this detailed answer!Well,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10588#10588</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 03-May-2011 at 11:27pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Thanks for this detailed answer!<div><br></div><div>Well, I don't feel it's necessary at all to capture the Exception on the VM, but those functional specs tell me to, and unfortunately customer's king. ;-)</div><div><br></div><div>I think I'll take your first suggestion (arbitrary string prop), because it seems to be at least a bit more straightforward. Especially because I can format the value the way it should be AND localized (which is not possilbe with XAML-inline-StringFormat).</div><div><br></div><div>Regarding the ErrorsChanged event: Maybe my quick shot, because i might remember reading something in the Rsrc-Center saying this event does not mean that errors changed, but gives you the ability to by checking the eventargs.</div><div><br></div><div>Once again thank you very much!</div><div><br></div><div>-Edit:</div><div><br></div><div>Ok, after trying I'm stuck again. I added a string-property to my Model and added a DecimalRangeVerifier:</div><div><br></div><div><div><font ="Apple-style-span" face="'Courier New', Courier, mono"><span ="Apple-tab-span" style="white-space: pre; ">	</span>&#091;Bindable(true, BindingDirection.TwoWay)&#093;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &#091;Editable(true)&#093;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &#091;Display(Name = "Payment", AutoGenerateField = true)&#093;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &#091;DecimalRangeVerifier(MinValue = 0d, MaxValue = 1000000d)&#093;</font><span ="Apple-style-span" style="font-family: 'Courier New', Courier, mono; ">&#093;</span></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &#091;DataMember&#093;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; public string PaymentFormatted</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; {</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return string.Format(CultureInfo.CurrentCulture, "{0:c}", PropertyMetadata.Payment.GetValue(this));</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; decimal decValue;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var valOk = decimal.TryParse(value, NumberStyles.Currency, CultureInfo.CurrentCulture, out decValue);</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (valOk)&nbsp;</font><span ="Apple-style-span" style="font-family: 'Courier New', Courier, mono; ">PropertyMetadata.Payment.SetValue(this, decValue);</span></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></div></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono"><br></font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono"><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; ">But how do I get the Verification running? I also tried VerifierEngine.ExecuteBeforeSet in the setter and a VerifierException was thrown, but I do not want to throw an exception, obviously I want the Exception to show up in the Dataform. The DefaultVerifierOptions are unchanged, the ErrorNotificationMode is "Notify".</span></font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono"><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "><br></span></font></div><div><font ="Apple-style-span" face="'Courier New', Courier, mono"><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; ">I hope you can help me out of this mess one more time!</span></font></div></div><span style="font-size:10px"><br /><br />Edited by AuerRo - 04-May-2011 at 12:54am</span>]]>
   </description>
   <pubDate>Tue, 03 May 2011 23:27:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10588#10588</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Hi Roland;By default, System.FormatException...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10587#10587</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 03-May-2011 at 6:58pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Hi Roland;<div><br></div><div>By default, System.FormatException that is thrown by DataForm is not sent over to the ViewModel. The exception is being trapped at the View only. That is why you don't see various Entity level events being fired.&nbsp;</div><div><br></div><div>If you really want to capture the exception on the VM, you can do one of 2 things:</div><div><br></div><div>1. Create an arbitrary string property and bind that to a TextBox. That string property in return can be assigned to the numeric property after your validation.</div><div><br></div><div>or</div><div><br></div><div>2. Create your own value converter class which you can manage on your VM.</div><div><br></div><div>I think you'll realize that this might not be as straightforward as you'd hope so I guess the question is whether you really feel it is necessary to capture the FormatException on the VM.</div><div><br></div><div>Regarding the INotifyDataErrorInfo.ErrorsChanged event, that might or might not be a bug. I was able to reproduce the issue here and what I'm seeing is that any kind of property change whether it results in an error or not, will trigger the ErrorsChanged event. This sound incorrect but I will confirm and get back to you as soon as possible.</div></div>]]>
   </description>
   <pubDate>Tue, 03 May 2011 18:58:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10587#10587</guid>
  </item> 
  <item>
   <title>Verification, SLtoolkit-Dataform and the good old FormatException : Hi, i have the following problem...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10575#10575</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1095" rel="nofollow">AuerRo</a><br /><strong>Subject:</strong> 2648<br /><strong>Posted:</strong> 02-May-2011 at 4:52am<br /><br />Hi, i have the following problem (which might not even be related to DevForce...)<div><br></div><div>In my SL4-MVVM-App with latest DevForceSL, I'd like to check application-wide if there are unsaved entities (works great) or erroneous entities (that's the problem).</div><div><br></div><div>DevForce Verification in the Silverlight-Toolkit-Dataform works fine, except for the case where I have a numeric property (eg. typeof decimal), and I insert an alphanumeric value (eg. "500a") in the View's TextBox. A FormatException is thrown by the Dataform, I get the Error displayed in the Dataform (just like a normal Verification-Error) but the value (or the Validation/Verification-Error) is not handed over to the entity in the VM, and (as consequence) EntityAspect.ValidationErrors doesn't change.</div><div><br></div><div>The real fun was, when inserting "ValidatesOnExceptions=True, NotifyOnValidationError=True" in the Datafield's Binding, nothing changed. Neither of these events fire: Entity.PropertyChanged, Entity.EntityAspect.PropertyChanged and ((INotifyDataErrorInfo)Entity).ErrorsChanged; Weirdest thing is, if I change the input back to a valid value (eg. from "500a" to "500",&nbsp;((INotifyDataErrorInfo)Entity).ErrorsChanged fires. I'm completely confused!&nbsp;</div><div><br></div><div>Question is: How do I catch the Error in the ViewModel? Is there a recommended way to handle this with DevForce?</div><div><br></div><div>Thanks for any hint! Roland</div><div><br></div>]]>
   </description>
   <pubDate>Mon, 02 May 2011 04:52:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2648&amp;PID=10575#10575</guid>
  </item> 
 </channel>
</rss>