/// <summary> /// Prints a discrete value created with this frame. /// The value is provided explicitely. /// </summary> /// <param name="printContext">The context used to print the cell.</param> /// <param name="value">The value to print.</param> /// <param name="origin">The location where to start printing.</param> public virtual void Print(ILayoutPrintContext printContext, int value, Point origin) { Debug.Assert(value >= 0 && value < Items.Count); ILayoutKeywordFrame KeywordFrame = Items[value]; Debug.Assert(KeywordFrame != null); KeywordFrame.Print(printContext, origin); }
/// <summary> /// Prints a cell created with this frame. /// </summary> /// <param name="printContext">The context used to print the cell.</param> /// <param name="cellView">The cell to print.</param> /// <param name="origin">The location where to start printing.</param> /// <param name="size">The printing size, padding included.</param> /// <param name="padding">The padding to use when printing.</param> public virtual void Print(ILayoutPrintContext printContext, ILayoutCellView cellView, Point origin, Size size, Padding padding) { ILayoutDiscreteContentFocusableCellView DiscreteContentFocusableCellView = cellView as ILayoutDiscreteContentFocusableCellView; Debug.Assert(DiscreteContentFocusableCellView != null); ILayoutKeywordFrame KeywordFrame = DiscreteContentFocusableCellView.KeywordFrame; Debug.Assert(KeywordFrame != null); KeywordFrame.Print(printContext, DiscreteContentFocusableCellView, origin, size, padding); }
/// <summary> /// Measures a cell created with this frame. /// </summary> /// <param name="measureContext">The context used to measure the cell.</param> /// <param name="cellView">The cell to measure.</param> /// <param name="collectionWithSeparator">A collection that can draw separators around the cell.</param> /// <param name="referenceContainer">The cell view in <paramref name="collectionWithSeparator"/> that contains this cell.</param> /// <param name="separatorLength">The length of the separator in <paramref name="collectionWithSeparator"/>.</param> /// <param name="size">The cell size upon return, padding included.</param> /// <param name="padding">The cell padding.</param> public virtual void Measure(ILayoutMeasureContext measureContext, ILayoutCellView cellView, ILayoutCellViewCollection collectionWithSeparator, ILayoutCellView referenceContainer, Measure separatorLength, out Size size, out Padding padding) { ILayoutDiscreteContentFocusableCellView DiscreteContentFocusableCellView = cellView as ILayoutDiscreteContentFocusableCellView; Debug.Assert(DiscreteContentFocusableCellView != null); ILayoutKeywordFrame KeywordFrame = DiscreteContentFocusableCellView.KeywordFrame; Debug.Assert(KeywordFrame != null); KeywordFrame.Measure(measureContext, DiscreteContentFocusableCellView, collectionWithSeparator, referenceContainer, separatorLength, out size, out padding); Debug.Assert(padding.IsEmpty); measureContext.UpdatePadding(LeftMargin, RightMargin, ref size, out padding); Debug.Assert(RegionHelper.IsValid(size)); }
/// <summary> /// Initializes a new instance of the <see cref="LayoutDiscreteContentFocusableCellView"/> class. /// </summary> /// <param name="stateView">The state view containing the tree with this cell.</param> /// <param name="parentCellView">The collection of cell views containing this view. Null for the root of the cell tree.</param> /// <param name="frame">The frame that created this cell view.</param> /// <param name="propertyName">Property corresponding to the component of the node.</param> /// <param name="keywordFrame">The keyword frame that was used to create this cell.</param> public LayoutDiscreteContentFocusableCellView(ILayoutNodeStateView stateView, ILayoutCellViewCollection parentCellView, ILayoutFrame frame, string propertyName, ILayoutKeywordFrame keywordFrame) : base(stateView, parentCellView, frame, propertyName, keywordFrame) { Debug.Assert(keywordFrame.ParentFrame is ILayoutDiscreteFrame); CellOrigin = RegionHelper.InvalidOrigin; CellSize = RegionHelper.InvalidSize; CellPadding = Padding.Empty; ActualCellSize = RegionHelper.InvalidSize; }