本文整理汇总了C#中MvxValueEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MvxValueEventArgs类的具体用法?C# MvxValueEventArgs怎么用?C# MvxValueEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MvxValueEventArgs类属于命名空间,在下文中一共展示了MvxValueEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveJoystickOnNewCoordinates
private void MoveJoystickOnNewCoordinates(object sender, MvxValueEventArgs<CartesianPositionParameters> eventArgs)
{
if (ViewModel != null)
{
ViewModel.Movement.RollCommand.Execute(eventArgs.Value);
}
}
示例2: ImageHelperOnImageChanged
private void ImageHelperOnImageChanged(object sender, MvxValueEventArgs<UIImage> mvxValueEventArgs)
{
InvokeOnMainThread(() =>
{
if (ImageView != null)
ImageView.Image = mvxValueEventArgs.Value;
});
}
示例3: HandleCreateCalled
protected override void HandleCreateCalled(object sender, MvxValueEventArgs<Bundle> bundleArgs)
{
FragmentView.EnsureSetupInitialized();
// Create is called after Fragment is attached to Activity
// it's safe to assume that Fragment has activity
if (!FragmentView.GetType().IsFragmentCacheable(Fragment.Activity.GetType()))
return;
FragmentView.RegisterFragmentViewToCacheIfNeeded(Fragment.Activity.GetType());
Bundle bundle = null;
MvxViewModelRequest request = null;
if (bundleArgs?.Value != null)
{
// saved state
bundle = bundleArgs.Value;
}
else
{
var fragment = FragmentView as Fragment;
if (fragment?.Arguments != null)
{
bundle = fragment.Arguments;
var json = bundle.GetString("__mvxViewModelRequest");
if (!string.IsNullOrEmpty(json))
{
IMvxNavigationSerializer serializer;
if (!Mvx.TryResolve(out serializer))
{
MvxTrace.Warning(
"Navigation Serializer not available, deserializing ViewModel Request will be hard");
}
else
{
request = serializer.Serializer.DeserializeObject<MvxViewModelRequest>(json);
}
}
}
}
IMvxSavedStateConverter converter;
if (!Mvx.TryResolve(out converter))
{
MvxTrace.Warning("Saved state converter not available - saving state will be hard");
}
else
{
if (bundle != null)
{
var mvxBundle = converter.Read(bundle);
FragmentView.OnCreate(mvxBundle, request);
}
}
}
示例4: NewIntent
protected override void NewIntent(MvxValueEventArgs<Intent> e)
{
string id=GetIdFromTag(e.Value);
var tagAsNdefMessage = e.Value.GetParcelableArrayExtra(NfcAdapter.ExtraNdefMessages);
if (tagAsNdefMessage != null)
{
var tag = tagAsNdefMessage[0] as NdefMessage;
byte[] message = tag.ToByteArray();
var ndefMessage = NdefLibrary.Ndef.NdefMessage.FromByteArray(message);
NewMessage(id,ndefMessage);
}
}
示例5: HandleCreateCalled
protected override void HandleCreateCalled(object sender, MvxValueEventArgs<Bundle> bundleArgs)
{
FragmentView.EnsureSetupInitialized();
if (!FragmentView.GetType().IsOwnedViewModelFragment())
return;
Bundle bundle = null;
MvxViewModelRequest request = null;
if (bundleArgs != null && bundleArgs.Value != null)
{
// saved state
bundle = bundleArgs.Value;
}
else
{
var fragment = FragmentView as Fragment;
if (fragment != null && fragment.Arguments != null)
{
bundle = fragment.Arguments;
var json = bundle.GetString("__mvxViewModelRequest");
if (!string.IsNullOrEmpty(json))
{
IMvxNavigationSerializer serializer;
if (!Mvx.TryResolve(out serializer))
{
MvxTrace.Warning(
"Navigation Serializer not available, deserializing ViewModel Request will be hard");
}
else
{
request = serializer.Serializer.DeserializeObject<MvxViewModelRequest>(json);
}
}
}
}
IMvxSavedStateConverter converter;
if (!Mvx.TryResolve(out converter))
{
MvxTrace.Warning("Saved state converter not available - saving state will be hard");
}
else
{
if (bundle != null)
{
var mvxBundle = converter.Read(bundle);
FragmentView.OnCreate(mvxBundle, request);
}
}
}
示例6: EventSourceOnStartActivityForResultCalled
protected override void EventSourceOnStartActivityForResultCalled(object sender,
MvxValueEventArgs
<MvxStartActivityForResultParameters>
MvxValueEventArgs)
{
var requestCode = MvxValueEventArgs.Value.RequestCode;
switch (requestCode)
{
case (int)MvxIntentRequestCode.PickFromFile:
MvxTrace.Warning("Warning - activity request code may clash with Mvx code for {0}",
(MvxIntentRequestCode)requestCode);
break;
}
}
示例7: AccelerometerOnReadingAvailable
private void AccelerometerOnReadingAvailable(object sender, MvxValueEventArgs<Reading> mvxValueEventArgs)
{
// note that the switchover between Y and X here is deliberate!
// and that we invert Y
// this may need tweaking platform-by-platform
// and phone by phone - and maybe at runtime too!
var parameters = new CartesianPositionParameters
{
X = MakeSafe(-mvxValueEventArgs.Value.Y),
Y = MakeSafe(mvxValueEventArgs.Value.X),
};
DoRoll(parameters);
}
示例8: EventSourceOnSaveInstanceStateCalled
protected override void EventSourceOnSaveInstanceStateCalled(object sender, MvxValueEventArgs<Bundle> bundleArgs)
{
var mvxBundle = AndroidView.CreateSaveStateBundle();
if (mvxBundle != null)
{
IMvxSavedStateConverter converter;
if (!Mvx.TryResolve<IMvxSavedStateConverter>(out converter))
{
MvxTrace.Warning("Saved state converter not available - saving state will be hard");
}
else
{
converter.Write(bundleArgs.Value, mvxBundle);
}
}
var cache = Mvx.Resolve<IMvxSingleViewModelCache>();
cache.Cache(AndroidView.ViewModel, bundleArgs.Value);
}
示例9: SpeechListenerOnHeard
private void SpeechListenerOnHeard(object sender, MvxValueEventArgs<PossibleWord> e)
{
if (!SpeechIsOn)
return;
MethodInfo methodInfo;
if (!_speechMethods.TryGetValue(e.Value.Word, out methodInfo))
return;
methodInfo.Invoke(this, new object[0]);
this.InvokeOnMainThread(() =>
{
HeardSoFar.Insert(0, e.Value.Word);
while (HeardSoFar.Count > 100)
{
HeardSoFar.RemoveAt(HeardSoFar.Count - 1);
}
});
}
示例10: HandleAttachCalled
protected virtual void HandleAttachCalled(object sender, MvxValueEventArgs<Activity> e)
{
}
示例11: HandleCreateCalled
protected virtual void HandleCreateCalled(object sender, MvxValueEventArgs<Bundle> e)
{
}
示例12: HandleSaveInstanceStateCalled
protected virtual void HandleSaveInstanceStateCalled(object sender, MvxValueEventArgs<Bundle> e)
{
}
示例13: EventSourceOnCreateCalled
protected override void EventSourceOnCreateCalled(object sender, MvxValueEventArgs<Bundle> eventArgs)
{
this.AndroidView.OnViewCreate(eventArgs.Value);
}
示例14: ImageHelperOnImageChanged
private void ImageHelperOnImageChanged(object sender, MvxValueEventArgs<Bitmap> mvxValueEventArgs)
{
using (var h = new Handler(Looper.MainLooper)) h.Post(() => { this.SetImageBitmap(mvxValueEventArgs.Value); });
}
示例15: HandleViewDidAppearCalled
public virtual void HandleViewDidAppearCalled(object sender, MvxValueEventArgs<bool> e)
{
}