[Solved] Binding to data that will be resloved asyncronously
-
Hi all, Just got a view and a viewmodel to wire-up. The view needs to be bound to some properties that will be resolved asyncly after the execution of a certain command. Ok, I wrote all the stuff but now i'm confused with how to declare the binding??? Any ideas???? Here's just a skeleton View - initially just a textbox and a ok button. On clicking the ok button, the results are displayed and the command to resolve values are sent to the viewmodel. In viewmodel,
public class MainViewModel : ViewModelBase
{//properties that are to be resolved private string \_data; private int \_time; public string Data { get { return \_data; } set { \_data = value; NotifyPropertyChange("Data"); } } //and so on...
}
I need the value of a Textblock to be bound with "Data". But that will be resolved after a while... Out of ideas!:confused: Please help.
-
Hi all, Just got a view and a viewmodel to wire-up. The view needs to be bound to some properties that will be resolved asyncly after the execution of a certain command. Ok, I wrote all the stuff but now i'm confused with how to declare the binding??? Any ideas???? Here's just a skeleton View - initially just a textbox and a ok button. On clicking the ok button, the results are displayed and the command to resolve values are sent to the viewmodel. In viewmodel,
public class MainViewModel : ViewModelBase
{//properties that are to be resolved private string \_data; private int \_time; public string Data { get { return \_data; } set { \_data = value; NotifyPropertyChange("Data"); } } //and so on...
}
I need the value of a Textblock to be bound with "Data". But that will be resolved after a while... Out of ideas!:confused: Please help.
Try from within the view.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial
-
Try from within the view.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial
This will be enough? :doh: so simple! Ofcourse, the confusion was that it was to be resolved asyncly.
-
Hi all, Just got a view and a viewmodel to wire-up. The view needs to be bound to some properties that will be resolved asyncly after the execution of a certain command. Ok, I wrote all the stuff but now i'm confused with how to declare the binding??? Any ideas???? Here's just a skeleton View - initially just a textbox and a ok button. On clicking the ok button, the results are displayed and the command to resolve values are sent to the viewmodel. In viewmodel,
public class MainViewModel : ViewModelBase
{//properties that are to be resolved private string \_data; private int \_time; public string Data { get { return \_data; } set { \_data = value; NotifyPropertyChange("Data"); } } //and so on...
}
I need the value of a Textblock to be bound with "Data". But that will be resolved after a while... Out of ideas!:confused: Please help.
-
Hi all, Just got a view and a viewmodel to wire-up. The view needs to be bound to some properties that will be resolved asyncly after the execution of a certain command. Ok, I wrote all the stuff but now i'm confused with how to declare the binding??? Any ideas???? Here's just a skeleton View - initially just a textbox and a ok button. On clicking the ok button, the results are displayed and the command to resolve values are sent to the viewmodel. In viewmodel,
public class MainViewModel : ViewModelBase
{//properties that are to be resolved private string \_data; private int \_time; public string Data { get { return \_data; } set { \_data = value; NotifyPropertyChange("Data"); } } //and so on...
}
I need the value of a Textblock to be bound with "Data". But that will be resolved after a while... Out of ideas!:confused: Please help.
Binding to that property in the normal way should work fine. Data binding is essentially asynchronous all the time, in that the view's updated by notification events and not directly by code, so it should work just the same. Make sure that the VM sends a value that the view can deal with before the asynchronous call returns, though (this might mean making the view accept null).
-
Binding to that property in the normal way should work fine. Data binding is essentially asynchronous all the time, in that the view's updated by notification events and not directly by code, so it should work just the same. Make sure that the VM sends a value that the view can deal with before the asynchronous call returns, though (this might mean making the view accept null).
Thank you, Here's my solution,