public SpModel
{
Static dictionary<string,string> exposedDictOfValues;
List resultsFromSharepointXml
GetSharepointXmlAsync{
...
resultsFromSharepointXml = _list.getItems(query);
executeQueryAsync(success,fail);
...
}
success()
{
exposedDictOfValues = Convert(resultsFromSharepointXml);
}
fail(){}
}
public ViewModel : INotifyPropertyChanged
{
public string MyProp
{
get
{
return SpModel.exposedDictOfValues["myProp"]
}
set
{
if(SpModel.exposedDictOfValues["myProp"] != value)
{
SpModel.exposedDictOfValues["myProp"] = value;
NotifyPropChange("MyProp");
}
}
}
}
public View
{
view(){
DataContext = ViewModel;
}
}
view.xaml
<textbox Text={Binding MyProp,Mode=TwoWay} />
1 Replies - 2647 Views - Last Post: 24 January 2013 - 11:27 AM
#1
Databinding issue with Async Sharepoint and Dictionary
Posted 22 January 2013 - 09:26 AM
I have to update textboxes text with data that is returned from Sharepoint. The data is shared across many viewmodels so I store it into a static dictionary. The problem occurs when the thread accessing sharepoint returns, the properties are not notified of change/ changed.
Replies To: Databinding issue with Async Sharepoint and Dictionary
#2
Re: Databinding issue with Async Sharepoint and Dictionary
Posted 24 January 2013 - 11:27 AM
Figured it out. Passed down the UI Dispatcher and executed the method using it and the viewmodel as a singleton.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote



|