当前位置: 首页>>代码示例>>C#>>正文


C# MvxValueEventArgs类代码示例

本文整理汇总了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);
     }
 }
开发者ID:jihlee,项目名称:BallControl,代码行数:7,代码来源:SpheroView.xaml.cs

示例2: ImageHelperOnImageChanged

 private void ImageHelperOnImageChanged(object sender, MvxValueEventArgs<UIImage> mvxValueEventArgs)
 {
     InvokeOnMainThread(() =>
     {
         if (ImageView != null)
             ImageView.Image = mvxValueEventArgs.Value;
     });
 }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:8,代码来源:GeneralTableViewCell.cs

示例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);
                }
            }
        }
开发者ID:thefex,项目名称:MvvmCross-AndroidSupport,代码行数:55,代码来源:MvxBindingFragmentAdapter.cs

示例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);
            }
        }
开发者ID:rossdargan,项目名称:MvxPlugins,代码行数:13,代码来源:ReadBase.cs

示例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);
                }
            }
        }
开发者ID:Everbridge,项目名称:sm-MvvmCross,代码行数:51,代码来源:MvxBindingFragmentAdapter.cs

示例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;
     }
 }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:14,代码来源:MvxActivityAdapter.cs

示例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);
        }
开发者ID:slodge,项目名称:BallControl,代码行数:15,代码来源:SpheroAccelMovementViewModel.cs

示例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);
 }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:18,代码来源:MvxActivityAdapter.cs

示例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);
                    }
                });
        }
开发者ID:jihlee,项目名称:BallControl,代码行数:20,代码来源:SpheroSpeechViewModel.cs

示例10: HandleAttachCalled

 protected virtual void HandleAttachCalled(object sender, MvxValueEventArgs<Activity> e)
 {
 }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:3,代码来源:MvxBaseFragmentAdapter.cs

示例11: HandleCreateCalled

 protected virtual void HandleCreateCalled(object sender, MvxValueEventArgs<Bundle> e)
 {
 }
开发者ID:Everbridge,项目名称:sm-MvvmCross,代码行数:3,代码来源:MvxBaseFragmentAdapter.cs

示例12: HandleSaveInstanceStateCalled

 protected virtual void HandleSaveInstanceStateCalled(object sender, MvxValueEventArgs<Bundle> e)
 {
 }
开发者ID:Everbridge,项目名称:sm-MvvmCross,代码行数:3,代码来源:MvxBaseFragmentAdapter.cs

示例13: EventSourceOnCreateCalled

 protected override void EventSourceOnCreateCalled(object sender, MvxValueEventArgs<Bundle> eventArgs)
 {
     this.AndroidView.OnViewCreate(eventArgs.Value);
 }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:4,代码来源:MvxActivityAdapter.cs

示例14: ImageHelperOnImageChanged

 private void ImageHelperOnImageChanged(object sender, MvxValueEventArgs<Bitmap> mvxValueEventArgs)
 {
     using (var h = new Handler(Looper.MainLooper)) h.Post(() => { this.SetImageBitmap(mvxValueEventArgs.Value); });
 }
开发者ID:lothrop,项目名称:MvvmCross-AndroidSupport,代码行数:4,代码来源:MvxAppCompatImageView.cs

示例15: HandleViewDidAppearCalled

 public virtual void HandleViewDidAppearCalled(object sender, MvxValueEventArgs<bool> e)
 {
 }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:3,代码来源:MvxBaseViewControllerAdapter.cs


注:本文中的MvxValueEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。