Skip to content

Commit c072df7

Browse files
Merge pull request #4 from NatarajanSF4844/VersionUpdate
Version-Update
2 parents d71282e + 50e1430 commit c072df7

13 files changed

+47
-30
lines changed

ManageAppointments/ManageAppointments/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public App()
99
MainPage = new LoginPage();
1010
}
1111

12-
protected override Window CreateWindow(IActivationState activationState)
12+
protected override Window CreateWindow(IActivationState? activationState)
1313
{
1414
var window = base.CreateWindow(activationState);
1515
window.Width = 800;

ManageAppointments/ManageAppointments/AppointmentsPage.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<local:MonthToImageConverter x:Key="MonthToImageConverter"/>
1414
<DataTemplate x:Key="AgendaHeaderTemplate">
1515
<Grid>
16-
<Image Aspect="Fill" Source="{Binding Converter={StaticResource MonthToImageConverter}}"/>
17-
<Label x:Name="label" HorizontalOptions="Start" VerticalOptions="Start" TextColor="Black" FontSize="16" Padding="55, 20, 0, 0" Text="{Binding StringFormat='{0:MMMM yyyy}'}"/>
16+
<Image Aspect="Fill" x:DataType="local:SchedulerViewModel" Source="{Binding Converter={StaticResource MonthToImageConverter}}"/>
17+
<Label x:Name="label" x:DataType="local:SchedulerViewModel" HorizontalOptions="Start" VerticalOptions="Start" TextColor="Black" FontSize="16" Padding="55, 20, 0, 0" Text="{Binding StringFormat='{0:MMMM yyyy}'}"/>
1818
</Grid>
1919
</DataTemplate>
2020
</Grid.Resources>
@@ -33,7 +33,7 @@
3333
</VerticalStackLayout>
3434
</Grid>
3535
<Grid Background="#f8f7ff" Grid.Row="1" >
36-
<scheduler:SfScheduler View="Agenda" x:Name="Scheduler" AppointmentsSource="{Binding Events}" DisplayDate="{Binding DisplayDate}">
36+
<scheduler:SfScheduler View="Agenda" x:Name="Scheduler" x:DataType="local:SchedulerViewModel" AppointmentsSource="{Binding Events}" DisplayDate="{Binding DisplayDate}">
3737
<scheduler:SfScheduler.AppointmentMapping>
3838
<scheduler:SchedulerAppointmentMapping
3939
Subject="EventName"

ManageAppointments/ManageAppointments/AppointmentsPage.xaml.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Microsoft.Maui;
1+
using Microsoft.Extensions.Logging.Abstractions;
2+
using Microsoft.Maui;
23
using Microsoft.Maui.Controls;
34
using System;
45
using System.Collections.Generic;
@@ -14,8 +15,10 @@ public partial class AppointmentsPage : ContentPage
1415
public AppointmentsPage()
1516
{
1617
InitializeComponent();
17-
var upcomingEvents = (this.BindingContext as SchedulerViewModel).Events.Where(x => (x as Appointment).From > DateTime.Now).ToList();
18-
this.Scheduler.AppointmentsSource = upcomingEvents;
18+
var upcomingEvents = (this.BindingContext as SchedulerViewModel)?.Events?.Where(x => (x as Appointment).From > DateTime.Now).ToList();
19+
if(upcomingEvents != null)
20+
this.Scheduler.AppointmentsSource = upcomingEvents;
21+
1922
this.Scheduler.MinimumDateTime = DateTime.Now;
2023
}
2124

@@ -28,7 +31,11 @@ private void Button_Clicked(object sender, EventArgs e)
2831

2932
if (button != null && button.Text == "Upcoming appointments")
3033
{
31-
var upcomingEvents = (this.BindingContext as SchedulerViewModel).Events.Where(x=>(x as Appointment).From > DateTime.Now).ToList();
34+
var upcomingEvents = (this.BindingContext as SchedulerViewModel)?.Events?.Where(x => (x as Appointment).From > DateTime.Now).ToList();
35+
if (upcomingEvents == null)
36+
{
37+
return;
38+
}
3239
if(upcomingAppointmentBorder !=null)
3340
{
3441
upcomingAppointmentBorder.Color = Color.FromArgb("#512BD4");
@@ -44,7 +51,12 @@ private void Button_Clicked(object sender, EventArgs e)
4451
}
4552
else if (button != null && button.Text == "Past appointments")
4653
{
47-
var pastAppointments = (this.BindingContext as SchedulerViewModel).Events.Where(x => (x as Appointment).From < DateTime.Now).ToList();
54+
var pastAppointments = (this.BindingContext as SchedulerViewModel)?.Events?.Where(x => (x as Appointment).From < DateTime.Now).ToList();
55+
56+
if(pastAppointments == null)
57+
{
58+
return;
59+
}
4860

4961
if (pastAppointmentBordeer != null)
5062
{

ManageAppointments/ManageAppointments/CalendarPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ContentPage.BindingContext>
1010
<ContentPage.Resources>
1111
<DataTemplate x:Key="dayAppointmentTemplate">
12-
<Grid RowDefinitions="0.35*,0.65*" Background="{Binding DataItem.Background}" >
12+
<Grid RowDefinitions="0.35*,0.65*" x:DataType="scheduler:SchedulerAppointment" Background="{Binding DataItem.Background}" >
1313
<Label Text="{Binding DataItem.EventName}" VerticalOptions="Start" TextColor="White" LineBreakMode="WordWrap" Margin="5,0" FontSize="12" />
1414
<Image Aspect="AspectFit" VerticalOptions="Start" Grid.Row="1" HorizontalOptions="Center"
1515
HeightRequest="30" WidthRequest="30"
@@ -20,7 +20,7 @@
2020

2121
</ContentPage.Resources>
2222
<Border Stroke="#F6F6F6" Background="#f8f7ff" StrokeThickness="2">
23-
<scheduler:SfScheduler View="Week" AppointmentsSource="{Binding Events}" DisplayDate="{Binding DisplayDate}">
23+
<scheduler:SfScheduler View="Week" x:DataType="local:SchedulerViewModel" AppointmentsSource="{Binding Events}" DisplayDate="{Binding DisplayDate}">
2424
<scheduler:SfScheduler.AppointmentMapping>
2525
<scheduler:SchedulerAppointmentMapping
2626
Subject="EventName"

ManageAppointments/ManageAppointments/Converter/MonthToImageConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ManageAppointments
77
/// </summary>
88
internal class MonthToImageConverter : IValueConverter
99
{
10-
public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
10+
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
1111
{
1212
if (value != null)
1313
{
@@ -18,7 +18,7 @@ internal class MonthToImageConverter : IValueConverter
1818
return null;
1919
}
2020

21-
public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21+
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
2222
{
2323
return null;
2424
}

ManageAppointments/ManageAppointments/LoginPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<Image Source="login.png" Grid.Row="0" Grid.Column="0" HorizontalOptions="Center" Aspect="AspectFit"/>
2121
</Border>
2222

23-
<Frame CornerRadius="10" Grid.Column="{OnPlatform Default=0, WinUI=1,MacCatalyst=1}" HorizontalOptions="Start" BorderColor="White" HeightRequest="420" Background="#f2e6ff"
23+
<Frame Grid.Column="{OnPlatform Default=0, WinUI=1,MacCatalyst=1}" HorizontalOptions="Start" HeightRequest="420" Background="#f2e6ff"
2424
Grid.Row="0"
2525
WidthRequest="380" VerticalOptions="Center"
2626
Grid.ColumnSpan="{OnPlatform Default=2, WinUI=1,MacCatalyst=1}"
@@ -44,7 +44,7 @@
4444
</Label>
4545

4646
<dataForm:SfDataForm x:Name="loginForm" LayoutType="TextInputLayout"
47-
Grid.Row="1" DataObject="{Binding LoginFormModel}" TextInputLayoutSettings="{dataForm:TextInputLayoutSettings FocusedStroke=#a64dff}"
47+
Grid.Row="1" x:DataType="local:ProfileViewModel" DataObject="{Binding LoginFormModel}" TextInputLayoutSettings="{dataForm:TextInputLayoutSettings FocusedStroke=#a64dff}"
4848
ValidationMode="PropertyChanged" >
4949
</dataForm:SfDataForm>
5050

ManageAppointments/ManageAppointments/LoginPage.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ private async void loginButton_Clicked(object sender, EventArgs e)
1919
if (this.loginForm != null && App.Current?.MainPage != null)
2020
{
2121
if (this.loginForm.Validate())
22-
{
22+
{
2323
App.Current.MainPage = new NavigationPage();
24-
App.Current.MainPage.Navigation.PushAsync(new AppShell());
25-
24+
App.Current.MainPage.Navigation?.PushAsync(new AppShell());
2625
}
2726
else
2827
{
29-
await App.Current.MainPage.DisplayAlert("", "Please enter the required details", "OK");
28+
await DisplayAlert("", "Please enter the required details", "OK");
3029
}
3130
}
3231

ManageAppointments/ManageAppointments/ManageAppointments.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.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 -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
99
<RootNamespace>ManageAppointments</RootNamespace>
1010
<UseMaui>true</UseMaui>
1111
<SingleProject>true</SingleProject>
1212
<ImplicitUsings>enable</ImplicitUsings>
13+
<Nullable>enable</Nullable>
1314

1415
<!-- Display name -->
1516
<ApplicationTitle>ManageAppointments</ApplicationTitle>
@@ -77,8 +78,9 @@
7778
</ItemGroup>
7879

7980
<ItemGroup>
80-
<PackageReference Include="Syncfusion.Maui.DataForm" Version="22.1.37" />
81-
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="22.1.37" />
81+
<PackageReference Include="Syncfusion.Maui.DataForm" Version="*" />
82+
<PackageReference Include="Syncfusion.Maui.Scheduler" Version="*" />
83+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
8284
</ItemGroup>
8385

8486
<ItemGroup>

ManageAppointments/ManageAppointments/ManageAppointments.csproj.user

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
5-
<ActiveDebugFramework>net7.0-windows10.0.19041.0</ActiveDebugFramework>
5+
<ActiveDebugFramework>net9.0-windows10.0.19041.0</ActiveDebugFramework>
66
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
77
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
8+
<DefaultDevice>pixel_5_-_api_34</DefaultDevice>
89
</PropertyGroup>
910
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-android|AnyCPU'">
1011
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
1112
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-android|AnyCPU'">
14+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
15+
</PropertyGroup>
1216
<ItemGroup>
1317
<MauiXaml Update="AppShell.xaml">
1418
<SubType>Designer</SubType>

ManageAppointments/ManageAppointments/Model/Appointment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Appointment : INotifyPropertyChanged
1414
private bool isAllDay;
1515
private string eventName;
1616
private Brush background;
17-
public string location;
17+
public string location = string.Empty;
1818
public Appointment()
1919
{
2020
this.from = DateTime.Now;

ManageAppointments/ManageAppointments/Model/LoginFormModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class LoginFormModel
1212
{
1313
[Display(Prompt = "[email protected]", Name = "Email")]
1414
[EmailAddress(ErrorMessage = "Enter your email - [email protected]")]
15-
public string Email { get; set; }
15+
public string Email { get; set; } = string.Empty;
1616

1717
[Display(Name = "Password")]
1818
[DataType(DataType.Password)]
1919
[Required(ErrorMessage = "Enter the password")]
20-
public string Password { get; set; }
20+
public string Password { get; set; } = string.Empty ;
2121
}
2222
}

ManageAppointments/ManageAppointments/Model/Profile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public ProfileDetails()
2727
this.EmergencyContactNumber = "88888888";
2828
}
2929

30-
[DataFormDisplayOptions(ShowLabel =false)]
31-
public string Image { get; set; }
30+
[DataFormDisplayOptions(ShowLabel = false)]
31+
public string Image { get; set; } = string.Empty;
3232
public string Name { get; set; }
3333
public DateTime DOB { get; set; }
3434
public string Gender { get; set; }

ManageAppointments/ManageAppointments/ProfilePage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<local:ProfileViewModel/>
99
</ContentPage.BindingContext>
1010
<ContentPage.Content>
11-
<dataform:SfDataForm x:Name="dataForm" IsReadOnly="True" Background="#f8f7ff" DataObject="{Binding ProfileDetails}"/>
11+
<dataform:SfDataForm x:Name="dataForm" IsReadOnly="True" Background="#f8f7ff" x:DataType="local:ProfileViewModel" DataObject="{Binding ProfileDetails}"/>
1212
</ContentPage.Content>
1313
</ContentPage>

0 commit comments

Comments
 (0)