Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Based on my understanding, the states you have to provide is a dynamic immutable list of options where you want to prompt user to enable/disable each of them, then return result as original string. </p> <p>If the list is a static list that you expect, for instance states, I'd surely suggest you having a list of states, and mapping against it.</p> <p>Make an Tag class that implement INotifyPropertyChanged, that has two props (name, selected) and remember to raise the <code>PropertyChanged</code> for each property change (I see it's excluded from your code, I assume for brevity purposes).</p> <p>Make a List subclass, add a string constructor and override the ToString(), make all the parsing in this class and return the result on the ToString, then call it from you ViewModel.</p> <p>I now realize that you tagged the question with <a href="https://stackoverflow.com/questions/tagged/ria" title="ria"><img src="https://i.stack.imgur.com/PX220.png" alt="RIA"></a>, so why would you want to bind against that comma delimited string?</p> <p>You might want to expose the options in the server and treat it like this, so the client doesn't know it's a comma delimited.</p> <pre><code>public class OptionsViewModel : ViewModelBase { public OptionsViewModel() { IsBusy = True; var context = new MyDomainContext(); _Tags = context.Tags; //if called elsewhere but from ctor, make sure context.IsLoading is false; //The Load method is throwing an exception if re-loading when a load is on. //Debug.Assert(!context.IsLoading); context.Load( context.GetTagsQuery(), (op) =&gt; { if(op.HasError &amp;&amp; !op.IsErrorHandled) op.MarkErrorAsHandlere(); IsBusy = false; }, null); } private readonly Ienumerable&lt;Tag&gt; _Tags; public Ienumerable&lt;Tag&gt; Tags { get { return _Tags; } } } </code></pre> <p>In the server expose an operation that returns that datacontract (of Tag) and the server should do the comma string parsing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload