/// <summary> /// Constructs a TextScrollViewer using the specified text, font, and color. /// </summary> /// <param name="text"></param> /// <param name="font"></param> /// <param name="color"></param> public TextScrollViewer(string text, Font font, Color color) { // Create the ScrollViewer object. _viewer = new ScrollViewer(); // Create the ScrollText object using the parameters passed into the // constructor and then set other important member values. ScrollText = new ScrollerText(text, font, color); ScrollText.HorizontalAlignment = HorizontalAlignment.Left; ScrollText.VerticalAlignment = VerticalAlignment.Top; // Set the child of the viewer to be the ScrollText object. this._viewer.Child = ScrollText; // Hard code a line with and height based on the character 'A'. _viewer.LineWidth = font.CharWidth('A'); _viewer.LineHeight = font.Height; // Set the child of our class to be the ScrollViewer object. this.Children.Add(_viewer); }
/// <summary> /// Constructs a TextScrollViewer using the specified text, font, and color. /// </summary> /// <param name="text"></param> /// <param name="font"></param> /// <param name="color"></param> public TextScrollViewer(string text, Font font, Color color) { // Create the ScrollViewer object. _viewer = new ScrollViewer(); // Create the ScrollText object using the parameters passed into the // constructor and then set other important member values. ScrollText = new ScrollerText(text, font, color); ScrollText.HorizontalAlignment = HorizontalAlignment.Left; ScrollText.VerticalAlignment = VerticalAlignment.Top; // Set the child of the viewer to be the ScrollText object. this._viewer.Child = ScrollText; // Hard code a line with and height based on the character 'A'. _viewer.LineWidth = font.CharWidth('A'); _viewer.LineHeight = font.Height; // Set the child of our class to be the ScrollViewer object. this.Children.Add(_viewer); }