Skip to content

Commit b01b2bd

Browse files
Integrated Recurrence appointment with exception dates sample
1 parent 206406f commit b01b2bd

36 files changed

Lines changed: 1248 additions & 0 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Application
2+
x:Class="RecursiveExceptionAppointment.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:RecursiveExceptionAppointment">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
10+
<!-- Other merged dictionaries here -->
11+
</ResourceDictionary.MergedDictionaries>
12+
<!-- Other app resources here -->
13+
</ResourceDictionary>
14+
</Application.Resources>
15+
</Application>
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Runtime.InteropServices.WindowsRuntime;
6+
using Windows.ApplicationModel;
7+
using Windows.ApplicationModel.Activation;
8+
using Windows.Foundation;
9+
using Windows.Foundation.Collections;
10+
using Microsoft.UI.Xaml;
11+
using Microsoft.UI.Xaml.Controls;
12+
using Microsoft.UI.Xaml.Controls.Primitives;
13+
using Microsoft.UI.Xaml.Data;
14+
using Microsoft.UI.Xaml.Input;
15+
using Microsoft.UI.Xaml.Media;
16+
using Microsoft.UI.Xaml.Navigation;
17+
18+
// To learn more about WinUI, the WinUI project structure,
19+
// and more about our project templates, see: http://aka.ms/winui-project-info.
20+
21+
namespace RecursiveExceptionAppointment
22+
{
23+
/// <summary>
24+
/// Provides application-specific behavior to supplement the default Application class.
25+
/// </summary>
26+
sealed partial class App : Application
27+
{
28+
/// <summary>
29+
/// Initializes the singleton application object. This is the first line of authored code
30+
/// executed, and as such is the logical equivalent of main() or WinMain().
31+
/// </summary>
32+
public App()
33+
{
34+
this.InitializeComponent();
35+
#if !WinUI_Desktop
36+
this.Suspending += OnSuspending;
37+
#endif
38+
}
39+
40+
#if WinUI_Desktop
41+
/// <summary>
42+
/// Invoked when the application is launched normally by the end user. Other entry points
43+
/// will be used such as when the application is launched to open a specific file.
44+
/// </summary>
45+
/// <param name="args">Details about the launch request and process.</param>
46+
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
47+
{
48+
m_window = new MainWindow();
49+
m_window.Activate();
50+
}
51+
#else
52+
/// <summary>
53+
/// Invoked when the application is launched normally by the end user. Other entry points
54+
/// will be used such as when the application is launched to open a specific file.
55+
/// </summary>
56+
/// <param name="e">Details about the launch request and process.</param>
57+
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs e)
58+
{
59+
Frame rootFrame = Window.Current.Content as Frame;
60+
61+
// Do not repeat app initialization when the Window already has content,
62+
// just ensure that the window is active
63+
if (rootFrame == null)
64+
{
65+
// Create a Frame to act as the navigation context and navigate to the first page
66+
rootFrame = new Frame();
67+
68+
rootFrame.NavigationFailed += OnNavigationFailed;
69+
70+
if (e.UWPLaunchActivatedEventArgs.PreviousExecutionState == ApplicationExecutionState.Terminated)
71+
{
72+
//TODO: Load state from previously suspended application
73+
}
74+
75+
// Place the frame in the current Window
76+
Window.Current.Content = rootFrame;
77+
}
78+
79+
if (e.UWPLaunchActivatedEventArgs.PrelaunchActivated == false)
80+
{
81+
if (rootFrame.Content == null)
82+
{
83+
// When the navigation stack isn't restored navigate to the first page,
84+
// configuring the new page by passing required information as a navigation
85+
// parameter
86+
rootFrame.Navigate(typeof(MainPage), e.Arguments);
87+
}
88+
// Ensure the current window is active
89+
Window.Current.Activate();
90+
}
91+
}
92+
93+
/// <summary>
94+
/// Invoked when Navigation to a certain page fails
95+
/// </summary>
96+
/// <param name="sender">The Frame which failed navigation</param>
97+
/// <param name="e">Details about the navigation failure</param>
98+
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
99+
{
100+
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
101+
}
102+
103+
#endif
104+
105+
#if WinUI_Desktop
106+
/// <summary>
107+
/// Invoked when application execution is being suspended. Application state is saved
108+
/// without knowing whether the application will be terminated or resumed with the contents
109+
/// of memory still intact.
110+
/// </summary>
111+
/// <param name="sender">The source of the suspend request.</param>
112+
/// <param name="e">Details about the suspend request.</param>
113+
private void OnSuspending(object sender, SuspendingEventArgs e)
114+
{
115+
// Save application state and stop any background activity
116+
}
117+
private Window m_window;
118+
#else
119+
/// <summary>
120+
/// Invoked when application execution is being suspended. Application state is saved
121+
/// without knowing whether the application will be terminated or resumed with the contents
122+
/// of memory still intact.
123+
/// </summary>
124+
/// <param name="sender">The source of the suspend request.</param>
125+
/// <param name="e">Details about the suspend request.</param>
126+
private void OnSuspending(object sender, SuspendingEventArgs e)
127+
{
128+
var deferral = e.SuspendingOperation.GetDeferral();
129+
//TODO: Save application state and stop any background activity
130+
deferral.Complete();
131+
}
132+
#endif
133+
}
134+
}
1.4 KB
Loading
7.52 KB
Loading
2.87 KB
Loading
1.61 KB
Loading
1.23 KB
Loading
1.42 KB
Loading
3.13 KB
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
5+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
6+
<RootNamespace>RecursiveExceptionAppointment</RootNamespace>
7+
<ApplicationManifest>app.manifest</ApplicationManifest>
8+
<Platforms>x86;x64;arm64</Platforms>
9+
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
10+
<AssemblyName>RecursiveExceptionAppointment</AssemblyName>
11+
</PropertyGroup>
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
13+
<DefineConstants>WinUI_Desktop</DefineConstants>
14+
</PropertyGroup>
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
16+
<DefineConstants>WinUI_Desktop</DefineConstants>
17+
</PropertyGroup>
18+
<ItemGroup>
19+
<Compile Remove="BusinessObject_Desktop\**" />
20+
<Compile Remove="Model\**" />
21+
<Compile Remove="RecursiveExceptionAppointment_Desktop\**" />
22+
<Compile Remove="ViewModel\**" />
23+
<EmbeddedResource Remove="BusinessObject_Desktop\**" />
24+
<EmbeddedResource Remove="Model\**" />
25+
<EmbeddedResource Remove="RecursiveExceptionAppointment_Desktop\**" />
26+
<EmbeddedResource Remove="ViewModel\**" />
27+
<None Remove="BusinessObject_Desktop\**" />
28+
<None Remove="Model\**" />
29+
<None Remove="RecursiveExceptionAppointment_Desktop\**" />
30+
<None Remove="ViewModel\**" />
31+
<Page Remove="BusinessObject_Desktop\**" />
32+
<Page Remove="Model\**" />
33+
<Page Remove="RecursiveExceptionAppointment_Desktop\**" />
34+
<Page Remove="ViewModel\**" />
35+
</ItemGroup>
36+
<ItemGroup>
37+
<Compile Remove="MainPage.xaml.cs" />
38+
<Compile Remove="Properties\AssemblyInfo.cs" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<None Remove="BusinessObject_UWP_TemporaryKey.pfx" />
42+
<None Remove="MainPage.xaml" />
43+
<None Remove="Properties\Default.rd.xml" />
44+
<None Remove="RecursiveExceptionAppointment_UWP_TemporaryKey.pfx" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Page Remove="MainPage.xaml" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<Compile Include="Model\Event.cs" />
51+
<Compile Include="ViewModel\SchedulerViewModel.cs" />
52+
</ItemGroup>
53+
54+
<ItemGroup>
55+
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.19041.13" />
56+
<PackageReference Include="Microsoft.ProjectReunion" Version="0.5.0" />
57+
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.5.0" />
58+
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.5.0" />
59+
<PackageReference Include="Syncfusion.Core.WinUI" Version="19.1.0.56-beta" />
60+
<PackageReference Include="Syncfusion.Editors.WinUI" Version="19.1.0.56-beta" />
61+
<PackageReference Include="Syncfusion.Scheduler.WinUI" Version="19.1.0.56-beta" />
62+
<Manifest Include="$(ApplicationManifest)" />
63+
</ItemGroup>
64+
</Project>

0 commit comments

Comments
 (0)