本文整理汇总了C#中IZetboxContext.GetViewModelCache方法的典型用法代码示例。如果您正苦于以下问题:C# IZetboxContext.GetViewModelCache方法的具体用法?C# IZetboxContext.GetViewModelCache怎么用?C# IZetboxContext.GetViewModelCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IZetboxContext
的用法示例。
在下文中一共展示了IZetboxContext.GetViewModelCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fetch
public static FilterListEntryViewModel Fetch(IViewModelFactory f, IZetboxContext dataCtx, FilterListViewModel parent, FilterViewModel vmdl)
{
return (FilterListEntryViewModel)dataCtx.GetViewModelCache(f.PerfCounter).LookupOrCreate(vmdl, () => f.CreateViewModel<FilterListEntryViewModel.Factory>().Invoke(dataCtx, parent, vmdl));
}
示例2: Fetch
public static NavigationEntryViewModel Fetch(IViewModelFactory ModelFactory, IZetboxContext dataCtx, ViewModel parent, NavigationEntry screen)
{
if (ModelFactory == null) throw new ArgumentNullException("ModelFactory");
if (screen == null) throw new ArgumentNullException("screen");
return (NavigationEntryViewModel)dataCtx.GetViewModelCache(ModelFactory.PerfCounter).LookupOrCreate(screen, () =>
{
if (screen.ViewModelDescriptor != null)
{
try
{
var t = Type.GetType(screen.ViewModelDescriptor.ViewModelTypeRef, true);
return ModelFactory.CreateViewModel<NavigationEntryViewModel.Factory>(t).Invoke(dataCtx, parent, screen);
}
catch (Exception ex)
{
Logging.Client.WarnFormat("Unable to create ViewModel from Descriptor: {0}", ex);
}
}
return (NavigationEntryViewModel)screen.GetDefaultViewModel(dataCtx, parent);
});
}
示例3: Fetch
public static CompoundObjectViewModel Fetch(IViewModelFactory f, IZetboxContext dataCtx, ViewModel parent, ICompoundObject obj)
{
return (CompoundObjectViewModel)dataCtx.GetViewModelCache(f.PerfCounter).LookupOrCreate(obj, () => f.CreateViewModel<CompoundObjectViewModel.Factory>(obj).Invoke(dataCtx, parent, obj));
}
示例4: Fetch
public static FilterViewModel Fetch(IViewModelFactory f, IZetboxContext dataCtx, ViewModel parent, IUIFilterModel mdl)
{
return (FilterViewModel)dataCtx.GetViewModelCache(f.PerfCounter).LookupOrCreate(mdl, () => f.CreateViewModel<FilterViewModel.Factory>(mdl.ViewModelType).Invoke(dataCtx, parent, mdl));
}