Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Ruler for xamarin and maui diagram (Read 809 times)
Hidden
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Mar 13th, 2023
Ruler for xamarin and maui diagram
Mar 13th, 2023 at 8:04pm
Print Post  
Wpf diagram has a ruler however cannot locate for xamarin maui?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Ruler for xamarin and maui diagram
Reply #1 - Mar 14th, 2023 at 7:27am
Print Post  
Indeed, Ruler control (and Overview too) is not available yet in MAUI diagram. If only for displaying measures, you could draw them from diagram's DrawForeground event handler for time being:

Code
Select All
void OnDrawForeground(object sender, DiagramEventArgs e)
{
	var rulerBounds = diagram.Bounds;
	rulerBounds.Y = diagView.ScrollY;
	rulerBounds.Height = 6;

	e.Graphics.FillRectangle(
		MindFusion.Drawing.Brushes.White, rulerBounds);

	int startX = (int)(e.VisibleRect.X / 10) * 10;
	for (int x = startX; x < e.VisibleRect.Right; x += 10)
	{
		e.Graphics.DrawString(
			x.ToString(), diagram.Font,
			MindFusion.Drawing.Brushes.Black,
			x, rulerBounds.Y + 1);
	}
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint