Skip to content

Commit 1b95f5f

Browse files
Version Updated to .net 8
1 parent 182f426 commit 1b95f5f

File tree

21 files changed

+291
-258
lines changed

21 files changed

+291
-258
lines changed

9.0/AppointmentTemplate/AppointmentTemplate/AppearanceCustomizationBehavior.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using Syncfusion.Maui.Scheduler;
2+
using System;
3+
using System.Collections.Generic;
24
using System.Collections.ObjectModel;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
38

49
namespace AppointmentTemplate
510
{
@@ -8,12 +13,12 @@ public class AppearanceCustomizationBehavior : Behavior<SfScheduler>
813
/// <summary>
914
/// Holds the appointment source collection.
1015
/// </summary>
11-
private ObservableCollection<Meeting>? appointments;
16+
private ObservableCollection<Meeting> appointments;
1217

1318
/// <summary>
1419
/// Holds the scheduler object
1520
/// </summary>
16-
private SfScheduler? scheduler;
21+
private SfScheduler scheduler;
1722

1823
protected override void OnAttachedTo(SfScheduler bindable)
1924
{
@@ -22,7 +27,7 @@ protected override void OnAttachedTo(SfScheduler bindable)
2227
bindable.ViewChanged += this.OnSchedulerViewChanged;
2328
}
2429

25-
private void OnSchedulerViewChanged(object? sender, SchedulerViewChangedEventArgs e)
30+
private void OnSchedulerViewChanged(object sender, SchedulerViewChangedEventArgs e)
2631
{
2732
if (this.scheduler == null || e.NewVisibleDates == null)
2833
{

9.0/AppointmentTemplate/AppointmentTemplate/AppointmentTemplate.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
Lines changed: 44 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,111 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
x:Class="AppointmentTemplate.MainPage"
54
BackgroundColor="{DynamicResource SecondaryColor}"
65
xmlns:local="clr-namespace:AppointmentTemplate"
7-
xmlns:schedule="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler">
6+
xmlns:schedule="clr-namespace:Syncfusion.Maui.Scheduler;assembly=Syncfusion.Maui.Scheduler"
7+
x:Class="AppointmentTemplate.MainPage">
88

99
<Grid>
1010
<Grid.RowDefinitions>
11-
<RowDefinition />
12-
<RowDefinition Height="50" />
11+
<RowDefinition/>
12+
<RowDefinition Height="50"/>
1313
</Grid.RowDefinitions>
1414
<Grid.Resources>
1515
<DataTemplate x:Key="dayAppointmentTemplate">
1616
<Grid>
1717
<Grid.RowDefinitions>
18-
<RowDefinition Height="0.1*" />
19-
<RowDefinition Height="0.8*" />
20-
<RowDefinition Height="0.1*" />
18+
<RowDefinition Height="0.1*"/>
19+
<RowDefinition Height="0.8*"/>
20+
<RowDefinition Height="0.1*"/>
2121
</Grid.RowDefinitions>
22-
<Grid Grid.Row="0"
23-
x:DataType="local:Meeting"
24-
Background="{Binding Data.Background}"
25-
IsClippedToBounds="True">
26-
<Label Text="{Binding Data.EventName}"
27-
VerticalOptions="Center"
28-
TextColor="White"
29-
LineBreakMode="WordWrap"
30-
MaxLines="1"
31-
FontSize="Caption"
32-
FontAttributes="Bold"
33-
Margin="5,5,5,0" />
22+
<Grid Grid.Row="0" Background="{Binding Data.Background}" IsClippedToBounds="True">
23+
<Label Text="{Binding Data.EventName}" VerticalOptions="Center" TextColor="White" LineBreakMode="WordWrap" MaxLines="1" FontSize="Caption" FontAttributes="Bold" Margin="5,5,5,0"/>
3424
</Grid>
35-
<Grid Grid.Row="1"
36-
Background="{Binding Data.Background}"
37-
Opacity="0.8"
38-
IsClippedToBounds="True">
25+
<Grid Grid.Row="1" Background="{Binding Data.Background}" Opacity="0.8" IsClippedToBounds="True" >
3926
<Grid.RowDefinitions>
40-
<RowDefinition Height="0.3*" />
41-
<RowDefinition Height="0.7*" />
27+
<RowDefinition Height="0.3*"/>
28+
<RowDefinition Height="0.7*"/>
4229
</Grid.RowDefinitions>
43-
<Image Aspect="AspectFit"
44-
VerticalOptions="Center"
45-
Margin="0, 10, 0, 10"
46-
HorizontalOptions="Center"
47-
HeightRequest="{OnPlatform Android= 30, iOS=30, MacCatalyst=50}"
48-
WidthRequest="{OnPlatform Android= 30, iOS=30, MacCatalyst=50}"
49-
Source="{Binding Data.Location}" />
50-
<Label Text="{Binding Data.Notes}"
51-
Grid.Row="1"
52-
TextColor="White"
53-
LineBreakMode="WordWrap"
54-
Margin="3,3,3,0"
55-
FontSize="10" />
30+
<Image Aspect="AspectFit" VerticalOptions="Center" Margin="0, 10, 0, 10" HorizontalOptions="Center" HeightRequest="{OnPlatform Android= 30, iOS=30, MacCatalyst=50}" WidthRequest="{OnPlatform Android= 30, iOS=30, MacCatalyst=50}" Source="{Binding Data.Location}"/>
31+
<Label Text="{Binding Data.Notes}" Grid.Row="1" TextColor="White" LineBreakMode="WordWrap" Margin="3,3,3,0" FontSize="10" />
5632
</Grid>
57-
<BoxView Grid.Row="2"
58-
Background="{Binding Data.Background}" />
33+
<BoxView Grid.Row="2" Background="{Binding Data.Background}"/>
5934
</Grid>
6035

6136
</DataTemplate>
6237

6338
<DataTemplate x:Key="monthAppointmentTemplate">
6439
<Grid Margin="2,1">
6540
<Grid.ColumnDefinitions>
66-
<ColumnDefinition Width="0.1*" />
67-
<ColumnDefinition Width="0.9*" />
41+
<ColumnDefinition Width="0.1*"/>
42+
<ColumnDefinition Width="0.9*"/>
6843
</Grid.ColumnDefinitions>
69-
<Border StrokeThickness="1"
70-
Stroke="{Binding Data.Background}"
71-
Background="{Binding Data.Background}"
72-
Padding="0"
73-
Margin="0"
74-
Opacity="0.8">
44+
<Border StrokeThickness="1" Stroke="{Binding Data.Background}" Background="{Binding Data.Background}" Padding="0" Margin="0" Opacity="0.8">
7545
<Border.StrokeShape>
7646
<RoundRectangle CornerRadius="5, 0, 5, 0" />
7747
</Border.StrokeShape>
7848
</Border>
79-
<Border Grid.Column="1"
80-
Background="{Binding Data.Background}"
81-
Padding="0"
82-
Margin="-1, 0, 0, 0"
83-
StrokeThickness="1"
84-
Stroke="{Binding Data.Background}">
49+
<Border Grid.Column="1" Background="{Binding Data.Background}" Padding="0" Margin="-1, 0, 0, 0" StrokeThickness="1" Stroke="{Binding Data.Background}">
8550
<Border.StrokeShape>
8651
<RoundRectangle CornerRadius="0, 5, 0, 5" />
8752
</Border.StrokeShape>
88-
<Label Padding="3, 0, 0, 0"
89-
HorizontalTextAlignment="Start"
90-
Text="{Binding Data.EventName}"
91-
FontSize="10"
92-
FontAttributes="Bold"
93-
MaxLines="1"
94-
TextColor="White"
95-
LineBreakMode="WordWrap"
96-
HorizontalOptions="Start"
97-
VerticalOptions="Center" />
53+
<Label Padding="3, 0, 0, 0" HorizontalTextAlignment="Start" Text="{Binding Data.EventName}" FontSize="10" FontAttributes="Bold" MaxLines="1" TextColor="White" LineBreakMode="WordWrap" HorizontalOptions="Start" VerticalOptions="Center" />
9854
</Border>
9955
</Grid>
10056
</DataTemplate>
10157

10258
<DataTemplate x:Key="timelineAppointmentTemplate">
10359
<Grid Margin="2,1">
10460
<Grid.ColumnDefinitions>
105-
<ColumnDefinition Width="0.1*" />
106-
<ColumnDefinition Width="0.9*" />
61+
<ColumnDefinition Width="0.1*"/>
62+
<ColumnDefinition Width="0.9*"/>
10763
</Grid.ColumnDefinitions>
108-
<Border StrokeThickness="1"
109-
Stroke="{Binding Data.Background}"
110-
Background="{Binding Data.Background}"
111-
Padding="0"
112-
Margin="0"
113-
Opacity="0.8">
64+
<Border StrokeThickness="1" Stroke="{Binding Data.Background}" Background="{Binding Data.Background}" Padding="0" Margin="0" Opacity="0.8">
11465
<Border.StrokeShape>
11566
<RoundRectangle CornerRadius="5, 0, 5, 0" />
11667
</Border.StrokeShape>
11768
</Border>
118-
<Border Grid.Column="1"
119-
Background="{Binding Data.Background}"
120-
Padding="0"
121-
Margin="-1, 0, 0, 0"
122-
StrokeThickness="1"
123-
Stroke="{Binding Data.Background}">
69+
<Border Grid.Column="1" Background="{Binding Data.Background}" Padding="0" Margin="-1, 0, 0, 0" StrokeThickness="1" Stroke="{Binding Data.Background}">
12470
<Border.StrokeShape>
12571
<RoundRectangle CornerRadius="0, 5, 0, 5" />
12672
</Border.StrokeShape>
127-
<Label HorizontalTextAlignment="Center"
128-
Text="{Binding Data.EventName}"
129-
FontSize="10"
130-
FontAttributes="Bold"
131-
TextColor="White"
132-
LineBreakMode="WordWrap"
133-
HorizontalOptions="Center"
134-
VerticalOptions="Center" />
73+
<Label HorizontalTextAlignment="Center" Text="{Binding Data.EventName}" FontSize="10" FontAttributes="Bold" TextColor="White" LineBreakMode="WordWrap" HorizontalOptions="Center" VerticalOptions="Center" />
13574
</Border>
13675
</Grid>
13776
</DataTemplate>
13877
</Grid.Resources>
139-
<schedule:SfScheduler x:Name="Scheduler"
140-
View="TimelineDay"
141-
AllowedViews="Day,Week,WorkWeek,TimelineDay,TimelineWeek,TimelineWorkWeek">
78+
<schedule:SfScheduler x:Name="Scheduler"
79+
View="TimelineDay" AllowedViews="Day,Week,WorkWeek,TimelineDay,TimelineWeek,TimelineWorkWeek">
14280
<schedule:SfScheduler.AppointmentMapping>
143-
<schedule:SchedulerAppointmentMapping Subject="EventName"
144-
StartTime="From"
145-
EndTime="To"
146-
Background="Background"
147-
IsAllDay="IsAllDay"
148-
StartTimeZone="StartTimeZone"
149-
EndTimeZone="EndTimeZone"
150-
RecurrenceExceptionDates="RecurrenceExceptions"
151-
RecurrenceRule="RecurrenceRule"
152-
RecurrenceId="RecurrenceId" />
81+
<schedule:SchedulerAppointmentMapping
82+
Subject="EventName"
83+
StartTime="From"
84+
EndTime="To"
85+
Background="Background"
86+
IsAllDay="IsAllDay"
87+
StartTimeZone="StartTimeZone"
88+
EndTimeZone="EndTimeZone"
89+
RecurrenceExceptionDates="RecurrenceExceptions"
90+
RecurrenceRule="RecurrenceRule"
91+
RecurrenceId="RecurrenceId"/>
15392
</schedule:SfScheduler.AppointmentMapping>
15493
<schedule:SfScheduler.MonthView>
15594
<schedule:SchedulerMonthView AppointmentTemplate="{StaticResource monthAppointmentTemplate}"
156-
AppointmentDisplayMode="Text">
95+
AppointmentDisplayMode="Text" >
15796
</schedule:SchedulerMonthView>
15897
</schedule:SfScheduler.MonthView>
15998
<schedule:SfScheduler.TimelineView>
160-
<schedule:SchedulerTimelineView AppointmentTemplate="{StaticResource timelineAppointmentTemplate}" />
99+
<schedule:SchedulerTimelineView
100+
AppointmentTemplate="{StaticResource timelineAppointmentTemplate}" />
161101
</schedule:SfScheduler.TimelineView>
162102
<schedule:SfScheduler.DaysView>
163-
<schedule:SchedulerDaysView AppointmentTemplate="{StaticResource dayAppointmentTemplate}" />
103+
<schedule:SchedulerDaysView
104+
AppointmentTemplate="{StaticResource dayAppointmentTemplate}"/>
164105
</schedule:SfScheduler.DaysView>
165106
<schedule:SfScheduler.Behaviors>
166-
<local:AppearanceCustomizationBehavior />
107+
<local:AppearanceCustomizationBehavior/>
167108
</schedule:SfScheduler.Behaviors>
168109
</schedule:SfScheduler>
169110
</Grid>
170-
171111
</ContentPage>

9.0/AppointmentTemplate/AppointmentTemplate/Meeting.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
using System.Collections.ObjectModel;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
24
using System.ComponentModel;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
38

49
namespace AppointmentTemplate
510
{
@@ -14,9 +19,8 @@ public class Meeting : INotifyPropertyChanged
1419
private string rRUle;
1520
private string notes;
1621
private string location;
17-
private object recurrenceId = new object();
18-
private object id = new object();
19-
public object? Data { get; set; }
22+
private object recurrenceId;
23+
private object id;
2024

2125
public Meeting()
2226
{
@@ -36,7 +40,7 @@ public Meeting()
3640
/// <summary>
3741
/// Property changed event handler
3842
/// </summary>
39-
public event PropertyChangedEventHandler? PropertyChanged;
43+
public event PropertyChangedEventHandler PropertyChanged;
4044

4145
/// <summary>
4246
/// Gets or sets the value to display the start date.

AppointmentTemplate/AppointmentTemplate/App.xaml.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
public partial class App : Application
44
{
5-
public App()
6-
{
7-
InitializeComponent();
8-
9-
MainPage = new MainPage();
10-
}
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
protected override Window CreateWindow(IActivationState? activationState)
10+
{
11+
return new Window(new MainPage());
12+
}
1113
}

AppointmentTemplate/AppointmentTemplate/AppointmentTemplate.csproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7-
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
99
<RootNamespace>AppointmentTemplate</RootNamespace>
1010
<UseMaui>true</UseMaui>
1111
<SingleProject>true</SingleProject>
1212
<ImplicitUsings>enable</ImplicitUsings>
13+
<Nullable>enable</Nullable>
1314

1415
<!-- Display name -->
1516
<ApplicationTitle>AppointmentTemplate</ApplicationTitle>
1617

1718
<!-- App Identifier -->
1819
<ApplicationId>com.companyname.appointmenttemplate</ApplicationId>
19-
<ApplicationIdGuid>89BE51DA-205A-4F7F-BED8-0DDD5CF662B4</ApplicationIdGuid>
20+
<ApplicationIdGuid>79ec4ab5-03ea-4258-a778-dc9a9d690eb8</ApplicationIdGuid>
2021

2122
<!-- Versions -->
2223
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
2324
<ApplicationVersion>1</ApplicationVersion>
2425

25-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
26-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
2728
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
2829
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2930
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -49,7 +50,9 @@
4950
</ItemGroup>
5051

5152
<ItemGroup>
52-
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="20.1.58-preview" />
53+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
54+
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="*" />
55+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
5356
</ItemGroup>
5457

5558
</Project>

GettingStarted/App.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ public partial class App : Application
1010
public App()
1111
{
1212
InitializeComponent();
13-
14-
MainPage = new MainPage();
1513
}
16-
}
14+
protected override Window CreateWindow(IActivationState? activationState)
15+
{
16+
return new Window(new MainPage());
17+
}
18+
}
1719
}

0 commit comments

Comments
 (0)