C1.C1Preview Namespace > Style Class : AmbientParent Property |
If non-null, that style provides the values for ambient properties of the current style that have not been explicitly set.
If null, such properties are inherited from the style of the containing object.
This property is null by default.
Note that even if an AmbientParent has been specified, only ambient properties that have been explicitly set on that style or any of its own ambient parents (styles or containing objects) propagate to the current style. See example below for details.
C1PrintDocument doc = new C1PrintDocument(); RenderArea ra = new RenderArea(); ra.Style.FontBold = true; RenderText rt = new RenderText("my text"); ra.Style.AmbientParent = doc.Style; ra.Children.Add(rt); doc.Body.Children.Add(ra);
C1PrintDocument doc = new C1PrintDocument(); doc.Style.FontBold = false; // this line makes the difference! RenderArea ra = new RenderArea(); ra.Style.FontBold = true; RenderText rt = new RenderText("my text"); ra.Style.AmbientParent = doc.Style; ra.Children.Add(rt); doc.Body.Children.Add(ra);
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2