Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Scheduling for .NET MAUI, V1.0 (Read 1421 times)
Forum Admin
YaBB Administrator
*****
Offline


Rock and Roll

Posts: 698
Joined: Apr 6th, 2003
Scheduling for .NET MAUI, V1.0
Nov 7th, 2023 at 10:46am
Print Post  
MindFusion.Scheduling is now available for .NET MAUI. Currently supported targets are Windows, macOS, iOS and Android.

The nuget package is located at:

https://www.nuget.org/packages/MindFusion.Scheduling.Maui

Distribution including sample projects and help files is available here:

https://mindfusion.eu/MauiPlanner.zip

Call the UseMindFusionScheduling extension from CreateMauiApp to configure the library:

Code
Select All
namespace CalendarMauiApp;

using MindFusion.Scheduling;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseMindFusionScheduling()
            .......);

        return builder.Build();
    }
} 



In order to use MindFusion.Scheduling types in Xaml, import the "http://mindfusion.eu/scheduling/maui" namespace schema:

Code
Select All
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:cal="http://mindfusion.eu/scheduling/maui"
    x:Class="CalendarMauiApp.MainPage">

	<Grid>

		<cal:Calendar
			x:Name="calendar"
			CurrentView="Timetable"
			DragBehavior="Scroll"
            />

	</Grid></ContentPage> 



The MAUI library offers same API as other .NET scheduling controls by MindFusion:

Code
Select All
public MainPage()
{
	InitializeComponent();

	calendar.Date = DateTime.Today;

	var app1 = new Appointment();
	app1.StartTime = calendar.Date.AddDays(0);
	app1.EndTime = app1.StartTime + TimeSpan.FromHours(24);
	app1.HeaderText = "Hello";
	calendar.Schedule.Items.Add(app1);

	var app2 = new Appointment();
	app2.StartTime = calendar.Date.AddDays(1);
	app2.EndTime = app2.StartTime + TimeSpan.FromHours(24);
	app2.HeaderText = "World!";
	calendar.Schedule.Items.Add(app2);
}
 



Enjoy!
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint