Tailwind Traders Desktop
A Windows desktop coupon-reader sample for the Tailwind Traders retail brand, written in C# with WPF and Windows Forms. Published by Microsoft as a sample.
Business rules, traced to source lines.
These 6 rules are a sample of the 250 CoreStory V3 extracted from Tailwind Traders Desktop. Each one links to the exact lines on GitHub at commit 41e4d4f. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.
The view model copies coupon fields (Title from CouponText, Username from UserName, User from User, CouponImage from ImageUrl, CouponText from CouponText), computes ReadyToRedeem and Expired, and formats Expiration via ToLongDateString only when the supplied coupon is not null.
When the user clicks the redeem button, the coupon code from the current data context's CouponViewModel is submitted to CouponsService.Instance.RedeemedCoupon, and a message box showing "Coupon redeemed" is displayed; any exception during this process is caught and its message is written to the debug output.
- Coupon redeemed — message displayed after successful redemption
Scanning a coupon requires a non-empty Search value; if Search is null or empty, the scan is aborted and a notification with Content "Enter a valid coupon code" and Title "Invalid Coupon" is raised, with the confirmation callback setting Title to "Notified".
- Enter a valid coupon code — notification content shown when search is empty
- Invalid Coupon — notification title shown when search is empty
- Notified — title assigned by the notification callback
If the coupon lookup for the Search value returns the default value, the scan is aborted without publishing an event.
When the login service SignInAsync returns true, the view model clears the Message and requests navigation of the ContentRegion to "MainView".
- MainView — navigation target view name on successful sign-in
Also cited: L36
When the login service SignInAsync returns false, the view model sets Message to "The Sign In process could not be completed successfully.".
- The Sign In process could not be completed successfully. — Message value assigned when sign-in fails
Also cited: L36
What the application does
16 capabilities identified, grouping the 58 distinct features extracted. These are descriptions, not the cited rules above.
Coupon Scanning & Lookup
Capturing, scanning, searching, and retrieving coupons by code, location, or history.
- Coupon Code Scanning: Allows a user to submit a coupon code via the main input field by clicking the scan button.
- Coupon Location Lookup by Device Coordinates: Resolve nearby coupons using the device's latitude and longitude, with a Bing Maps key available for the lookup.
- Coupon Lookup by Code: Retrieve a coupon record by its code via the CouponsService, backed by the Coupons data store.
- Coupon Reader Control: Provides the coupon reading/scanning interface whose initialization bootstraps the coupon workflow for users.
- Coupon Scanning: Allows the user to trigger a scan of a coupon from the main view.
- Coupon Search: Users can search for coupons by entering and clearing a search term.
- Scan and Activate Coupon: Allows an operator to scan a coupon and retrieve its details from the activation panel.
- View Coupon Scan History: Provides access to the history of previously scanned coupons.
Coupon Display & History
Presenting coupon details and browsing, expanding, and viewing coupon and redemption history.
- Coupon Display: Capability that exposes coupon details such as its text, image, and expiration for presentation to users.
- Coupon History Display: Presents a scrollable, styled history of coupons with expandable row details and theming.
- Coupon History Viewing: Users can view the history of coupons they have redeemed or interacted with.
- Coupon Viewing: Users can view coupon details including title, text, image, and expiration status through a coupon view model.
- Redeemed Coupon History: Access the history of coupons that have been redeemed for an instance/customer.
- Row Header Toggle: User can toggle a row header via a button in the coupon history control to expand or collapse row details.
- User Identity Display: The coupon view surfaces the owning user's identity alongside coupon data.
Navigation & Application Shell
Hosting the main application view and shell, supporting view navigation and region-based navigation integration.
- Grid Layout: Contain and arrange content within a grid-based layout container.
- Main Application View: Provides the primary application window/view that hosts the main user interface.
- Region Name Display: Provides the set of named regions available, along with region content, for presentation in the UI.
- View Navigation: Supports navigation into and out of the main view for the WPF module.
- View Navigation Integration: Enables the login view to participate in region-based navigation with lifecycle hooks and navigation target checks.
- Window Display: Present a titled, sized window as the user-facing top-level container.
Project & Build Configuration
Defining and managing the MSBuild project structure, build configurations, package imports, and assembly metadata/packaging.
- Assembly and Package Management: Manages assembly identity and NuGet/package dependencies referenced by the project.
- Automatic Build: Automatically detects and builds the project's code to make it analyzable.
- Build Configuration: Supports selection and control of build configurations such as Debug and Release, including output paths and platform settings.
- NuGet Package Build Imports: Ensures MSBuild target imports for NuGet package build assets are present in the project file so packages restore and build correctly.
- Page and Resource Inclusion: Allows pages and other non-compiled content to be included in and managed within the project.
- Project File Structure: Defines and maintains the MSBuild project file structure that describes compilation, references, packaging, and build configuration.
Coupon Management & Redemption
Managing coupons end-to-end, including validation, redemption, redemption status, and cleaning.
- Coupon Cleaning: Allows the user to trigger a cleaning operation on a coupon from the main view.
- Coupon Management: Capability to look up coupons by code, list coupons, view a coupon's history, and redeem a coupon.
- Coupon Redemption: Allows a user to redeem a coupon from the coupon details interface.
- Coupon Redemption Status: Users can observe whether a coupon is ready to redeem or has expired.
- Coupon Validation: Validates coupon data and its regional configuration to determine which coupons are valid.
Cloud Infrastructure Provisioning
Deploying and configuring Azure SQL servers and databases with security and firewall policies.
- Azure SQL Database Deployment: Creates a SQL database on the provisioned server with advanced threat protection options.
- Azure SQL Server Deployment: Provisions an Azure SQL server with configurable location, SKU, tier, and administrator credentials.
- Firewall Rule Configuration: Configures server firewall rules including allowing Azure services and specific IP addresses.
- Security Alert Policy Configuration: Applies security alert policies to the SQL server for threat monitoring.
Map & Location Services
Displaying maps and resolving geolocation for location-based coupon behavior.
- Geolocation Simulation: Simulates geolocation over time for testing location-based behavior.
- Location Mapping: Displays a map centered on the device's current geographic coordinates using a Bing Maps key.
- Map Control Display: Renders and manages a map control for viewing geographic positions on screen.
- Map Display: A map control is presented within the user interface container.
Application Bootstrap & Composition
Bootstrapping the WPF application, creating the shell, and wiring dependency injection and module registrations.
- Application Bootstrap & Dependency Wiring: Initializes the application and registers the WPF core module's dependency-injection types so the app's services are wired up at startup.
- Application Startup and Shell Creation: Bootstraps the WPF application by creating the main shell window and wiring up module catalog and type registrations.
- WPF Application Runtime: Hosts the WPF application's ambient culture and resource lookup infrastructure that user-facing UI elements resolve against.
Coupon Input & Form State
Managing the coupon input field and resetting/clearing form state and application controls.
- Clear Current Coupon: Lets an operator reset the current coupon entry by clearing the form state.
- Initialize Application Controls: Sets up the main interaction controls when the application panel/form loads.
- Input Clearing: Lets a user clear the coupon code input field via the clear button.
Authentication & Sign-In
User authentication into the application through login and sign-in flows backed by a login service.
- User Login: Provides a login view capability for users to authenticate into the application.
- User Sign-In: Allows a user to authenticate into the application via the sign-in flow backed by the login service.
CI Repository Checkout & Security Analysis
Fetching repository contents for build workflows and running automated CodeQL security analysis.
- CodeQL Security Analysis: Automated static security analysis of the repository via CodeQL initialization and analysis.
- Repository Checkout: Fetches the repository contents into the workflow environment for subsequent steps.
Notifications & User Messaging
Informing users of events through notifications and on-screen status/feedback messages.
- User Message Display: Presents status or feedback messages to the user from the login view.
- User Notifications: Publishes notification requests to inform the user of events via the event aggregator.
Package Manifest Modeling
Represents parsed file/folder manifests with entries and assembly metadata for consumer inspection.
- Assembly Metadata Read: Exposes assembly/resource header information declared within a manifest for downstream inspection.
- Package Manifest Modeling: Represents a parsed file/folder manifest with named entries and assembly metadata so consumers can read and inspect the manifest's contents.
UI Value Conversion & Binding
Converting booleans to visibility states and binding UI element visibility to boolean values.
- Boolean-to-Visibility Conversion: Converts between boolean values and UI visibility states so that UI elements can be shown or hidden based on boolean data, in both directions.
- Boolean-to-Visibility UI Binding: A value-conversion feature that lets UI elements bind their visibility to a boolean value, including an inverted mode where true hides and false shows.
Localization & Resource Access
Providing culture-aware access to localized UI resources and assets for the application.
- Resource Localization: Provides culture-aware access to localized UI resources such as strings and other assets for the application.
Signature Capture
Opening an ink signature board to capture a customer signature for coupon transactions.
- Signature Board Display: Opens and shows a signature board, typically to capture a customer signature for a coupon transaction.
What was analyzed
- XAML · 8 files · 1,281 lines
- XML · 16 files · 1,221 lines
- C# · 32 files · 1,098 lines
- MSBuild script · 11 files · 832 lines
- Visual Studio Solution · 5 files · 339 lines
- JSON · 4 files · 145 lines
- C# Generated · 6 files · 132 lines
- Markdown · 2 files · 75 lines
- INI · 1 file · 64 lines
- Bourne Shell · 1 file · 43 lines
- YAML · 1 file · 25 lines
- Other (2 languages) · 2 files · 21 lines
Whole repository: 173 files. cloc 2.06 counts 5,276 lines of code in 89 of them (6,161 lines with comments and blanks).
Where this came from
Extracted by CoreStory V3 (build 4470 with two small engine fixes) using DeepSeek-V4.1-Flash from the public repository at commit 41e4d4f on 2026-11-13. Capability descriptions are from the same run.
- Repository microsoft/TailwindTraders-Desktop
- Commit 41e4d4f27f5001ce6ae461789d61e68668c345e3
- Line counts cloc 2.06
- Rule citations Each rule shown was checked: its quote was compared with the repository source at the cited lines at this commit.
Code excerpts are from the upstream repository and remain under its MIT license. CoreStory is not affiliated with or endorsed by Microsoft.
Want this for your own codebase?
Talk to us about mapping the business rules in your repositories.