Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.54 KB | None | 0 0
  1. #region Model
  2.  
  3. public class Model
  4. {
  5.  
  6. }
  7.  
  8. public class DerivedModel : Model
  9. {
  10.  
  11. }
  12.  
  13. #endregion
  14.  
  15. #region ViewModel
  16.  
  17. public abstract class ViewModel
  18. {
  19. public static ViewModel Create(Model model)
  20. {
  21. return (ViewModel)CreateInternal((dynamic) model);
  22. }
  23.  
  24. private static ViewModel<TModel> CreateInternal<TModel>(TModel model)
  25. {
  26. var viewModel = IoC.Get<ViewModel<DerivedModel>>();
  27. viewModel.Model = model;
  28. return viewModel;
  29. }
  30.  
  31. public Model Model { get { return GetModel(); } }
  32. internal abstract Model GetModel();
  33. }
  34.  
  35. public abstract class ViewModel<TModel> : ViewModel where TModel : Model
  36. {
  37. public new TModel Model { get; internal set; }
  38. internal override Model GetModel() { return Model; }
  39. }
  40.  
  41. [Export(typeof(ViewModel<DerivedModel>))]
  42. /*private*/ class MySpecializedModel : ViewModel<DerivedModel>
  43. {
  44. //specialization
  45. }
  46.  
  47. #endregion
  48.  
  49. System.Reflection.AmbiguousMatchException occurred
  50. Source=mscorlib
  51. StackTrace:
  52. mscorlib.dll!System.RuntimeType.GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) + 0x127 bytes
  53. mscorlib.dll!System.Type.GetProperty(string name, System.Reflection.BindingFlags bindingAttr) + 0x1f bytes
  54. PresentationFramework.dll!System.Windows.PropertyPath.GetPropertyHelper(System.Type ownerType, string propertyName) + 0x31 bytes
  55. PresentationFramework.dll!System.Windows.PropertyPath.ResolvePropertyName(string name, object item, System.Type ownerType, object context, bool throwOnError) + 0x8e bytes
  56. PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.GetInfo(int k, object item, ref MS.Internal.Data.PropertyPathWorker.SourceValueState svs) + 0x3b5 bytes
  57. PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.ReplaceItem(int k, object newO, object parent) + 0x302 bytes
  58. PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(int k, System.ComponentModel.ICollectionView collectionView, object newValue, bool isASubPropertyChange) + 0xea bytes
  59. PresentationFramework.dll!MS.Internal.Data.ClrBindingWorker.AttachDataItem() + 0x9e bytes
  60. PresentationFramework.dll!System.Windows.Data.BindingExpression.Activate(object item) + 0x10d bytes
  61. PresentationFramework.dll!System.Windows.Data.BindingExpression.AttachToContext(System.Windows.Data.BindingExpression.AttachAttempt attempt) + 0x33a bytes
  62. PresentationFramework.dll!System.Windows.Data.BindingExpression.AttachOverride(System.Windows.DependencyObject target, System.Windows.DependencyProperty dp) + 0xd1 bytes
  63. PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.OnAttach(System.Windows.DependencyObject d, System.Windows.DependencyProperty dp) + 0x38 bytes
  64. PresentationFramework.dll!System.Windows.StyleHelper.GetInstanceValue(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, System.Windows.FrameworkElement feChild, System.Windows.FrameworkContentElement fceChild, int childIndex, System.Windows.DependencyProperty dp, int i, ref System.Windows.EffectiveValueEntry entry) + 0x1a5 bytes
  65. PresentationFramework.dll!System.Windows.StyleHelper.GetChildValueHelper(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, ref MS.Utility.ItemStructList<System.Windows.ChildValueLookup> valueLookupList, System.Windows.DependencyProperty dp, System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, bool styleLookup, ref System.Windows.EffectiveValueEntry entry, out System.Windows.ValueLookupType sourceType, System.Windows.FrameworkElementFactory templateRoot) + 0x4e7 bytes
  66. PresentationFramework.dll!System.Windows.StyleHelper.GetChildValue(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, int childIndex, MS.Internal.FrameworkObject child, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, ref System.Windows.EffectiveValueEntry entry, out System.Windows.ValueLookupType sourceType, System.Windows.FrameworkElementFactory templateRoot) + 0xbc bytes
  67. PresentationFramework.dll!System.Windows.StyleHelper.GetValueFromTemplatedParent(System.Windows.DependencyObject container, int childIndex, MS.Internal.FrameworkObject child, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, System.Windows.FrameworkElementFactory templateRoot, ref System.Windows.EffectiveValueEntry entry) + 0x52 bytes
  68. PresentationFramework.dll!System.Windows.StyleHelper.ApplyTemplatedParentValue(System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, System.Windows.DependencyProperty dp, System.Windows.FrameworkElementFactory templateRoot) + 0x78 bytes
  69. PresentationFramework.dll!System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, bool isDetach, System.Windows.FrameworkElementFactory templateRoot) + 0x8c bytes
  70. PresentationFramework.dll!System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(System.Windows.DependencyObject container, object currentObject) + 0xcf bytes
  71. PresentationFramework.dll!System.Windows.FrameworkTemplate.HandleBeforeProperties(object createdObject, ref System.Windows.DependencyObject rootObject, System.Windows.DependencyObject container, System.Windows.FrameworkElement feContainer, System.Windows.Markup.INameScope nameScope) + 0x2d bytes
  72. PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent.AnonymousMethod__3(object sender, System.Xaml.XamlObjectEventArgs args) + 0x24 bytes
  73. System.Xaml.dll!System.Xaml.XamlObjectWriter.OnBeforeProperties(object value) + 0x46 bytes
  74. System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(MS.Internal.Xaml.Context.ObjectWriterContext ctx) + 0xfe bytes
  75. System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndObject() + 0x2ae bytes
  76. System.Xaml.dll!System.Xaml.XamlWriter.WriteNode(System.Xaml.XamlReader reader) + 0x65 bytes
  77. PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlReader templateReader, System.Xaml.XamlObjectWriter currentWriter) + 0x41 bytes
  78. PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlObjectWriter objectWriter) + 0x61 bytes
  79. PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(System.Windows.DependencyObject container, System.Windows.Markup.IComponentConnector componentConnector, System.Windows.Markup.IStyleConnector styleConnector, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren, System.Windows.UncommonField<System.Collections.Hashtable> templatedNonFeChildrenField) + 0x259 bytes
  80. PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadContent(System.Windows.DependencyObject container, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren) + 0x7b bytes
  81. PresentationFramework.dll!System.Windows.StyleHelper.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, System.Windows.FrameworkElementFactory templateRoot, int lastChildIndex, System.Collections.Specialized.HybridDictionary childIndexFromChildID, System.Windows.FrameworkTemplate frameworkTemplate) + 0xa5 bytes
  82. PresentationFramework.dll!System.Windows.FrameworkTemplate.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> templateDataField, System.Windows.FrameworkElement container) + 0x3b bytes
  83. PresentationFramework.dll!System.Windows.FrameworkElement.ApplyTemplate() + 0x7c bytes
  84. PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x40 bytes
  85. PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x1cc bytes
  86. PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) + 0x60 bytes
  87. PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x1cc bytes
  88. PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x1cc bytes
  89. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) + 0x281 bytes
  90. PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x1cc bytes
  91. PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x1cc bytes
  92. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) + 0xe9 bytes
  93. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) + 0x8a bytes
  94. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) + 0x3e6 bytes
  95. PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x1cc bytes
  96. PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x1cc bytes
  97. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) + 0xe9 bytes
  98. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) + 0x8a bytes
  99. PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) + 0x3e6 bytes
  100. PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x1cc bytes
  101. PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) + 0x1cc bytes
  102. PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) + 0x60 bytes > Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeViewItem.MeasureOverride(System.Windows.Size availableSize) Line 1537 + 0x28 bytes
  103.  
  104. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement