This project is read-only.

ReactiveMVVM v1.0

Rating: No reviews yet
Downloads: 79
Change Set: 2015
Released: Nov 22, 2011
Updated: Nov 25, 2011 by freebirds8281
Dev status: Stable Help Icon

Recommended Download

Application ReactiveMVVM v1.0
application, 787K, uploaded Nov 22, 2011 - 79 downloads

Release Notes

Example 1 property change:
public class Example1 : ViewModelBase{
string _Userid;
/// <summary>
/// person infomation of owner.
/// </summary>
public string Userid
{
get { return _Userid; }
set { this.RaiseAndSetIfChanged(x => x.Userid, ref _Userid, value, *true*); } // true, broadcast property change message.
}

//if the property changed to do......
this.ObservableProperty(x => x.Useid)
.DistinctUntilChanged()
//can do work in any scheduler by ObserveOn
.Subscribe(chg =>
{
if (!string.IsNullOrEmpty(chg.NewValue))
{
//TODO:
You work.
}
});
}

Example 2 Subscribe Command:
1>
this.GetPinCodeCommand = new RxCommand();
GetPinCodeCommand
.Subscribe(
x =>
{
var strle = OAuthHelper.GetSetting("PinCodeLocal");
strle = strle.Replace(" ", "");
var htmlStr = ((WebBrowser)x).SaveToString();
htmlStr = htmlStr.Replace(" ", "");
......
2>
this.GetPinCodeCommand = new RxCommand(dowork , canExecute,onError,afterCompleteWork, scheduer);

Example 3 Messager:
//Subscribe message action
Messenger.Default.Register<QueryMessage<UserInfo>>(
"GetUser",
qm => OAuthHelper.UserDataBase
.SubscribeQueryData(
lq => lq.Id == qm.Id,
OAuthHelper.CreateClient("USER_PROFILE", new ParameterCollection { { "user_id", qm.Id } })
.QueryingRemote(sf => sf.ReadUserProfileInfo()),
qm.Callback,
a => a.Id
)
,
scheduler: Scheduler.ThreadPool);

public class Example3 : ViewModelBase{
//Send meesage
Messenger.Send(new QueryMessage<UserInfo>
{
Id = userid,
//Sender = this,
Name = "GetUser",
Callback = x =>
{
CurrentUser.Person = x;
if (string.IsNullOrWhiteSpace(OAuthHelper.Account.ScreenName))
{
OAuthHelper.Account.ScreenName = x.ScreenName;
}
}
});

Reviews for this release

No reviews yet for this release.