Skip to content

Latest commit

Β 

History

History
374 lines (294 loc) Β· 10.2 KB

File metadata and controls

374 lines (294 loc) Β· 10.2 KB

πŸŽ‰ New Features Implementation Guide

Overview

This document describes the newly implemented features in the Desktop Calendar Widget application, including Always on Top, Reminder Notifications, and Recurring Events support.


1️⃣ Always on Top πŸ“Œ

Description

Keep the Desktop Calendar Widget visible above all other windows, ensuring you never miss important events or tasks.

How to Use

  1. Click the βš™οΈ Settings button in the top-right corner
  2. Check/Uncheck πŸ“Œ Always on Top
  3. The window will immediately stay on top of other windows when enabled

Technical Details

  • Implementation: MainViewModel.IsAlwaysOnTop property bound to Window.Topmost
  • Files Modified:
    • MainViewModel.cs: Added IsAlwaysOnTop property and ToggleAlwaysOnTopCommand
    • MainWindow.xaml: Added Topmost="{Binding IsAlwaysOnTop}"
    • MainWindow.xaml.cs: Added menu item in settings

Code Example

// MainViewModel.cs
public bool IsAlwaysOnTop
{
    get => _isAlwaysOnTop;
    set => SetProperty(ref _isAlwaysOnTop, value);
}

2️⃣ Reminder Notifications πŸ””

Description

Get desktop notifications for upcoming events at your preferred time before the event starts.

Features

  • Customizable Timing: Choose from 5 minutes to 1 day before event
  • Notification Options:
    • 5 minutes before
    • 15 minutes before
    • 30 minutes before (default)
    • 1 hour before
    • 2 hours before
    • 1 day before
  • Smart Notifications: Shows event title, time, and location
  • Auto-dismiss: Notifications automatically close after 30 seconds
  • Background Monitoring: Checks for upcoming events every minute

How to Use

Setting Reminders on New Events

  1. Click βž• Add to create a new event
  2. Fill in event details
  3. Check Set Reminder
  4. Select desired reminder time from dropdown
  5. Click Save

Setting Reminders on Existing Events

  1. Click the ✏️ (edit) icon next to an event
  2. Check Set Reminder
  3. Select desired reminder time
  4. Click Save

Visual Indicators

  • Events with reminders show a πŸ”” icon in the calendar view

Technical Details

New Model Properties

// CalendarEventModel.cs
public bool HasReminder { get; set; }
public int ReminderMinutes { get; set; } = 30;

NotificationService

  • Location: Core/Services/NotificationService.cs
  • Functionality:
    • Timer-based checking every 60 seconds
    • Tracks notified events to avoid duplicates
    • Creates WPF windows for notifications
    • Auto-dismisses after 30 seconds

Integration Points

// App.xaml.cs
private NotificationService? _notificationService;

protected override void OnStartup(StartupEventArgs e)
{
    // Initialize notification service
    _notificationService = new NotificationService(calendarService);
    _notificationService.Start();
}

Google Calendar API Integration

// GoogleCalendarService.cs
if (eventModel.HasReminder)
{
    googleEvent.Reminders = new Event.RemindersData
    {
        UseDefault = false,
        Overrides = new List<EventReminder>
        {
            new EventReminder
            {
                Method = "popup",
                Minutes = eventModel.ReminderMinutes
            }
        }
    };
}

3️⃣ Recurring Events Support πŸ”

Description

Create events that repeat on a schedule - daily, weekly, monthly, or yearly - with full Google Calendar synchronization.

Features

  • Frequency Options:
    • Daily
    • Weekly
    • Monthly
    • Yearly
  • End Date: Specify when the recurring series should end
  • RRULE Compliant: Uses standard iCalendar RRULE format
  • Google Sync: Fully synchronized with Google Calendar recurrence patterns
  • Visual Indicator: Recurring events show a πŸ” icon

How to Use

Creating Recurring Events

  1. Click βž• Add to create a new event
  2. Fill in event details
  3. Check Repeat Event
  4. Select frequency from dropdown (Day/Week/Month/Year)
  5. Set Ends on date (optional)
  6. Click Save

Editing Recurring Events

  1. Click the ✏️ (edit) icon next to a recurring event
  2. Modify recurrence settings as needed
  3. Click Save
  4. Changes sync to all instances in Google Calendar

Visual Indicators

  • Recurring events show a πŸ” icon in the calendar view

Technical Details

New Model Properties

// CalendarEventModel.cs
public bool IsRecurring { get; set; }
public string RecurrenceFrequency { get; set; } = "DAILY";
public int RecurrenceInterval { get; set; } = 1;
public DateTime? RecurrenceEndDate { get; set; }
public int? RecurrenceCount { get; set; }
public string? RecurrenceRule { get; set; }

RRULE Generation

// GoogleCalendarService.cs
if (eventModel.IsRecurring && eventModel.StartTime.HasValue)
{
    var rrule = $"RRULE:FREQ={eventModel.RecurrenceFrequency};INTERVAL={eventModel.RecurrenceInterval}";
    
    if (eventModel.RecurrenceEndDate.HasValue)
    {
        rrule += $";UNTIL={eventModel.RecurrenceEndDate.Value:yyyyMMdd}T000000Z";
    }
    
    googleEvent.Recurrence = new List<string> { rrule };
}

Example RRULE Patterns

  • Daily: RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20261231T000000Z
  • Weekly: RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20261231T000000Z
  • Monthly: RRULE:FREQ=MONTHLY;INTERVAL=1;UNTIL=20261231T000000Z
  • Yearly: RRULE:FREQ=YEARLY;INTERVAL=1;UNTIL=20261231T000000Z

4️⃣ UI Improvements 🎨

Enhanced Window Sizing

  • New Size: 700x500 (up from 650x450)
  • Min Constraints: 500x400 minimum size
  • Better Layout: More breathing room for content

Visual Indicators

  • πŸ”” Icon: Indicates event has reminder set
  • πŸ” Icon: Indicates recurring event
  • Icons appear inline with event title for easy identification

Improved Dialog Sizing

  • EventDialog: Now 500x500 with min constraints
  • Better spacing for new reminder and recurrence sections
  • Collapsible sections for recurrence options

Enhanced Calendar View

<TextBlock Grid.Row="0" Grid.Column="0" FontWeight="SemiBold" FontSize="14" TextWrapping="Wrap">
    <Run Text="{Binding Summary, Mode=OneWay}"/>
    <Run Text=" πŸ””" Visibility="{Binding HasReminder, Converter={StaticResource BooleanToVisibilityConverter}}"/>
    <Run Text=" πŸ”" Visibility="{Binding IsRecurring, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</TextBlock>

πŸ“Š Feature Comparison

Feature Before After
Always on Top ❌ Not available βœ… Toggle in settings
Event Reminders ❌ Not available βœ… 6 timing options
Recurring Events ❌ Not available βœ… 4 frequency types
Visual Indicators ❌ None βœ… πŸ”” and πŸ” icons
Window Size 650x450 700x500
Notification System ❌ None βœ… Desktop notifications

πŸ”§ Technical Architecture

Service Layer

App.xaml.cs
    β”œβ”€β”€ GoogleAuthService
    β”œβ”€β”€ GoogleCalendarService (enhanced)
    β”‚   β”œβ”€β”€ Reminder support
    β”‚   └── Recurrence support
    β”œβ”€β”€ GoogleTaskService
    β”œβ”€β”€ NotificationService (new)
    β”‚   β”œβ”€β”€ Timer-based checking
    β”‚   └── Notification windows
    └── SyncService

Data Flow

User Action β†’ ViewModel β†’ Service β†’ Google API
                ↓
            NotificationService
                ↓
        Desktop Notification

Key Files Modified/Created

New Files

  • Core/Services/NotificationService.cs - Reminder notification service

Modified Files

  1. Core/Models/CalendarEventModel.cs

    • Added reminder properties
    • Added recurrence properties
  2. Core/Services/GoogleCalendarService.cs

    • Enhanced with reminder mapping
    • Enhanced with RRULE support
  3. ViewModels/MainViewModel.cs

    • Added Always on Top property and command
  4. Views/EventDialog.xaml & .xaml.cs

    • Added reminder UI
    • Added recurrence UI
  5. Views/CalendarView.xaml

    • Added visual indicators
  6. MainWindow.xaml & .xaml.cs

    • Added Topmost binding
    • Added Always on Top menu item
  7. App.xaml.cs

    • Integrated NotificationService

🎯 Usage Scenarios

Scenario 1: Team Meeting with Reminder

  1. Create event: "Team Standup"
  2. Set time: 10:00 AM daily
  3. Enable reminder: 15 minutes before
  4. Set recurrence: Daily, ends in 1 month
  5. Result: Get notified at 9:45 AM every day

Scenario 2: Important Deadline

  1. Create event: "Project Deadline"
  2. Set date: Next Friday
  3. Enable reminder: 1 day before
  4. Result: Get notification on Thursday

Scenario 3: Weekly Review

  1. Create event: "Weekly Review"
  2. Set time: Friday 3:00 PM
  3. Enable reminder: 1 hour before
  4. Set recurrence: Weekly
  5. Result: Notified every Friday at 2:00 PM

πŸ› Known Limitations

  1. Notification Service:

    • Checks every minute (configurable)
    • Does not support system tray notifications
    • Requires app to be running
  2. Recurring Events:

    • Does not support complex recurrence patterns (e.g., "every 2nd Tuesday")
    • Limited to basic RRULE patterns
    • End date is preferred over count
  3. Always on Top:

    • Setting is not persisted across app restarts
    • Global setting (cannot be per-window if multiple instances)

πŸš€ Future Enhancements

Potential improvements for future versions:

  1. Enhanced Notifications:

    • System tray integration
    • Sound notifications
    • Snooze functionality
  2. Advanced Recurrence:

    • Complex patterns (e.g., "last Friday of month")
    • Exception dates
    • Edit single occurrence
  3. Persistent Settings:

    • Save Always on Top preference
    • Save default reminder time
    • Remember window position
  4. Multiple Reminders:

    • Support multiple reminders per event
    • Different notification types (popup, email, SMS)

πŸ“š Additional Resources


Last Updated: January 2026
Version: 1.1.0
Author: Desktop Calendar Widget Team