# binghomepage/bingwallpaper.windows architecture

> Architecture diagram of the GitHub repository binghomepage/bingwallpaper.windows, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/binghomepage/bingwallpaper.windows
- Repository: https://github.com/binghomepage/bingwallpaper.windows

## Overview

Bing Wallpaper is a Windows desktop app that fetches Bing’s image of the day, previews it, and applies it as the desktop wallpaper. The main workflow is to choose a country and fit, then apply once or create a recurring scheduled update; users can also refresh the preview or remove the task. Settings and logs are stored locally. The excerpts show the UI, settings, and wallpaper/task actions, but not the homepage-fetch implementation; its wiring is included only where directly called.

Main entry points: [`BingWallpaper/Main.cs`](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Main.cs) (Main window), [`BingWallpaper/Task.cs`](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Task.cs) (Wallpaper and task actions), [`BingWallpaper/Global.cs`](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Global.cs) (App paths and logging), [`BingWallpaper/About.cs`](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/About.cs) (About and logs UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_program["Application entry<br/>[Program.cs]"]
  node_main["Main window<br/>[Main.cs]"]
  node_about["About and logs UI<br/>[About.cs]"]
end

subgraph group_wallpaper["Image and wallpaper"]
  node_homepage["Bing image fetch<br/>[BingHomepage.xml]"]
  node_task["Wallpaper and task actions<br/>[Task.cs]"]
end

subgraph group_local["Local state and scheduling"]
  node_settings["Settings manager<br/>[Settings.cs]"]
  node_settingsfile["Settings file<br/>[Settings.cs]"]
  node_global["App paths and logging<br/>[Global.cs]"]
  node_logfile["Log file<br/>[Global.cs]"]
end

node_user(("Windows user"))
node_bing(("Bing homepage service"))
node_windows(("Windows desktop"))
node_scheduler(("Windows Task Scheduler"))

node_user -->|"uses"| node_main
node_program -->|"launches"| node_main
node_program -->|"runs once"| node_task
node_main -->|"reads and updates"| node_settings
node_main -->|"loads preview"| node_homepage
node_homepage -->|"fetches image"| node_bing
node_main -->|"apply or reset"| node_task
node_task -->|"fetches if needed"| node_homepage
node_task -->|"sets wallpaper"| node_windows
node_task -->|"creates or deletes task"| node_scheduler
node_settings -->|"reads and writes"| node_settingsfile
node_main -->|"logs events"| node_global
node_task -->|"uses paths and logs"| node_global
node_global -->|"appends"| node_logfile
node_main -->|"opens"| node_about
node_about -->|"checks log path"| node_global
node_about -->|"opens or deletes"| node_logfile

click node_program "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Program.cs"
click node_main "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Main.cs"
click node_about "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/About.cs"
click node_homepage "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/BingHomepage.xml"
click node_task "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Task.cs"
click node_settings "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Settings.cs"
click node_settingsfile "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Settings.cs"
click node_global "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Global.cs"
click node_logfile "https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Global.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_main,node_about,node_user toneBlue
class node_homepage,node_task toneAmber
class node_settings,node_settingsfile,node_global,node_logfile toneMint
class node_bing,node_windows toneIndigo
class node_scheduler toneRose
```

## Components

### Desktop interface

- [Application entry](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Program.cs): `BingWallpaper/Program.cs`
- [Main window](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Main.cs): `BingWallpaper/Main.cs`
- [About and logs UI](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/About.cs): `BingWallpaper/About.cs`

### Image and wallpaper

- [Bing image fetch](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/BingHomepage.xml): `BingWallpaper/BingHomepage.xml`
- [Wallpaper and task actions](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Task.cs): `BingWallpaper/Task.cs`

### Local state and scheduling

- [Settings manager](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Settings.cs): `BingWallpaper/Settings.cs`
- [Settings file](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Settings.cs): `BingWallpaper/Settings.cs`
- [App paths and logging](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Global.cs): `BingWallpaper/Global.cs`
- [Log file](https://github.com/binghomepage/bingwallpaper.windows/blob/master/BingWallpaper/Global.cs): `BingWallpaper/Global.cs`

### Other components

- **Windows user**
- **Bing homepage service**
- **Windows desktop**
- **Windows Task Scheduler**

## Connections

- Windows user → Main window: uses
- Application entry → Main window: launches
- Application entry → Wallpaper and task actions: runs once
- Main window → Settings manager: reads and updates
- Main window → Bing image fetch: loads preview
- Bing image fetch → Bing homepage service: fetches image
- Main window → Wallpaper and task actions: apply or reset
- Wallpaper and task actions → Bing image fetch: fetches if needed
- Wallpaper and task actions → Windows desktop: sets wallpaper
- Wallpaper and task actions → Windows Task Scheduler: creates or deletes task
- Settings manager → Settings file: reads and writes
- Main window → App paths and logging: logs events
- Wallpaper and task actions → App paths and logging: uses paths and logs
- App paths and logging → Log file: appends
- Main window → About and logs UI: opens
- About and logs UI → App paths and logging: checks log path
- About and logs UI → Log file: opens or deletes
