Hi,
I am using Publisher and subscriber events to display messages in the status bar of UI applciation.
In status bar presenter, I am subscribing it
public class StatusBarViewPresenter
{
private IStatusBarView _view;
private IEventAggregator _eventAggregator;
public StatusBarViewPresenter(IStatusBarView view, IEventAggregator eventAggregator)
{
view.Presenter = this;
this._view = view;
this._eventAggregator = eventAggregator;
_eventAggregator.GetEvent<StatusBarMsgShowEvent>().Subscribe(this.ShowMessage);
}
public void ShowMessage(string msg)
{
_view.ShowMsg(msg);
}}
In the code behind of status.xaml.cs i am updating it as
public void ShowMsg(string msg)
{
txtBlkStatusMsg.InvalidateVisual();
txtBlkStatusMsg.Text = msg;
}
In the presenter where I wish to publish it, I am using it as
public void setStausBarMessage(string strStatusMsg)
{
strStatusMsg = _downloadBusinessData.strStatusBarMessage;
_eventAggregator.GetEvent<StatusBarMsgShowEvent>().Publish(strStatusMsg);
}
where _downloadBusinessData is my business class in which I will have the strStatus messages.
as, I have many status msg's which needs to be displayed, I have to clear the status bar msg and the new status bar msg should be displayed when ever i call publish.....
(pls correct me if I am wrong....)
I am not able to display the status msg's one by one.. rather at the end of the functionality one final msg (which is the last status msg) will be displayed...
I mean thro out my functionality, if I have 20 status msg's it should display those 20 whien its publisehd.. .but it displays the 20th status msg once the entire desired operation is completed.
Please please help me Thanks Ramm