本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}