AmbientParent Property (Style)
Gets or sets the
Style that is the ambient parent of the current style.
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.
public Style AmbientParent {get; set;}
'Declaration
Public Property AmbientParent As Style
For instance, the following code: still prints "my text" in bold, while this code: prints "my text" using regular (non-bold) font. This is because
FontBold has been explicitly set to
false on the style assigned to the
AmbientParent on the text object.
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);