/// <summary> /// When overridden in a derived class, creates a data source wrapper which implements /// the template's binding expressions. /// </summary> /// <param name="dataSource">The object's data source.</param> /// <param name="dataSourceType">The object's data source type.</param> /// <param name="namescope">The template's namescope.</param> /// <returns>The wrapped data source.</returns> private Object CreateDataSourceWrapper(Object dataSource, Type dataSourceType, out Namescope namescope) { namescope = new Namescope(); if (String.IsNullOrEmpty(dataSourceWrapperName)) return dataSource; var uv = UltravioletContext.DemandCurrent(); var wrapper = uv.GetUI().GetPresentationFoundation().CreateDataSourceWrapperByName(dataSourceWrapperName, dataSource, namescope); return wrapper; }
/// <summary> /// Initializes a new instance of the <see cref="CompiledDataSourceWrapper"/> class. /// </summary> /// <param name="namescope">The namescope for this data source wrapper.</param> protected CompiledDataSourceWrapper(Namescope namescope) { Contract.Require(namescope, nameof(namescope)); this.namescope = namescope; }