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


C# IMvxViewModel.Start方法代码示例

本文整理汇总了C#中IMvxViewModel.Start方法的典型用法代码示例。如果您正苦于以下问题:C# IMvxViewModel.Start方法的具体用法?C# IMvxViewModel.Start怎么用?C# IMvxViewModel.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMvxViewModel的用法示例。


在下文中一共展示了IMvxViewModel.Start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunViewModelLifecycle

 protected void RunViewModelLifecycle(IMvxViewModel viewModel, IMvxBundle parameterValues, IMvxBundle savedState)
 {
     try
     {
         CallCustomInitMethods(viewModel, parameterValues);
         if (savedState != null)
         {
             CallReloadStateMethods(viewModel, savedState);
         }
         viewModel.Start();
     }
     catch (Exception exception)
     {
         throw exception.MvxWrap("Problem running viewModel lifecycle of type {0}", viewModel.GetType().Name);
     }
 }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:16,代码来源:MvxDefaultViewModelLocator.cs

示例2: TryLoad

        public virtual bool TryLoad(Type viewModelType,
                                    IMvxBundle parameterValues,
                                    IMvxBundle savedState,
                                    out IMvxViewModel viewModel)
        {
            viewModel = null;

            try
            {
                viewModel = (IMvxViewModel) Mvx.IocConstruct(viewModelType);
            }
            catch (Exception exception)
            {
                MvxTrace.Warning("Problem creating viewModel of type {0} - problem {1}",
                                 viewModelType.Name, exception.ToLongString());
                return false;
            }

            try
            {
                CallCustomInitMethods(viewModel, parameterValues);
                if (savedState != null)
                {
                    CallReloadStateMethods(viewModel, savedState);
                }
                viewModel.Start();
            }
            catch (Exception exception)
            {
                MvxTrace.Warning("Problem initialising viewModel of type {0} - problem {1}",
                                 viewModelType.Name, exception.ToLongString());
                return false;
            }

            return true;
        }
开发者ID:diegowazevedo,项目名称:MvvmCross.DesignTimeVM,代码行数:36,代码来源:MvxDefaultViewModelLocator.cs

示例3: RunViewModelLifecycle

 private static void RunViewModelLifecycle(IMvxViewModel viewModel, IMvxBundle savedState,
     MvxViewModelRequest request)
 {
     try
     {
         if (request != null)
         {
             var parameterValues = new MvxBundle(request.ParameterValues);
             viewModel.CallBundleMethods("Init", parameterValues);
         }
         if (savedState != null)
         {
             viewModel.CallBundleMethods("ReloadState", savedState);
         }
         viewModel.Start();
     }
     catch (Exception exception)
     {
         throw exception.MvxWrap("Problem running viewModel lifecycle of type {0}", viewModel.GetType().Name);
     }
 }
开发者ID:cyrilcathala,项目名称:MvvmCross-AndroidSupport,代码行数:21,代码来源:MvxFragmentExtensions.cs


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