Overview
Unit Converter supports conversion between various units of measurement across multiple categories. Simply select a category, enter a value in one unit, and instantly see the equivalent values in other units. Source Reference:src/Calculator/Views/UnitConverter.xaml.cs
Conversion Categories
Length
Distance and length measurements
Weight and Mass
Mass and weight conversions
Temperature
Temperature scales
Energy
Energy and work units
Area
Surface area measurements
Volume
Volume and capacity
Speed
Velocity and speed
Time
Time duration units
Power
Power and rate of energy
Data
Digital storage units
Pressure
Pressure measurements
Angle
Angular measurements
Conversion Interface
Dual Input/Output
The converter features two value fields:- Value 1 - Enter a value to convert from
- Value 2 - Enter a value to convert to
src/Calculator/Views/UnitConverter.xaml.cs:149-155
Unit Selection
Each value field has a dropdown to select the unit:- Searchable dropdown lists
- Units organized by category
- Common units appear first
- Support for both standard and metric systems
src/Calculator/Views/UnitConverter.xaml.cs:157-161
Special Features
Currency Converter
The Currency category has unique features:Currency conversion uses live exchange rates from Bing in retail builds. Developer builds use mock data with fictional planet names instead of countries.
src/CalcManager/UnitConverter.h:166-175
Network Status Handling
The converter intelligently handles different network conditions:- Normal Access - Automatically fetches latest rates
- Metered Connection - Prompts before downloading (opt-in)
- Offline - Uses cached rates with timestamp
src/Calculator/Views/UnitConverter.xaml.cs:238-252
Currency Features
- Auto-refresh - Rates refresh automatically when opening currency mode
- Manual refresh - Click refresh button to update rates
- Timestamp - Shows when rates were last updated
- Week-old warning - Visual indicator if rates are more than a week old
- Network status - Clear indication of connection state
src/Calculator/Views/UnitConverter.xaml.cs:167-180
Offline Indicators
When offline, the calculator displays a message with a link to network settings, allowing you to quickly restore connectivity.
src/Calculator/Views/UnitConverter.xaml.cs:284-317
Supplementary Results
For some categories, the converter shows additional common conversions automatically:- Displays frequently used unit equivalents
- Updates in real-time as you type
- Helps you quickly see values in multiple units simultaneously
Data Architecture
The converter uses a sophisticated conversion engine:Conversion Data Structure
src/CalcManager/UnitConverter.h:126-141
Unit Structure
Each unit contains:- ID - Unique identifier
- Name - Display name
- Accessible Name - Screen reader-friendly name
- Abbreviation - Short symbol
- Conversion flags - Source/target compatibility
- Whimsical flag - For special units (e.g., mock currency units)
src/CalcManager/UnitConverter.h:16-73
User Interface Features
Animation
Smooth transitions when:- Switching categories
- Updating values
- Opening the converter
src/Calculator/Views/UnitConverter.xaml.cs:75-81
RTL Support
Full right-to-left language support:- Layout direction adapts to language
- Currency symbols positioned correctly for locale
- Text alignment follows cultural norms
src/Calculator/Views/UnitConverter.xaml.cs:46-56
Context Menu
Right-click on any value to:- Copy - Copy the value to clipboard
- Paste - Paste a value from clipboard
src/Calculator/Views/UnitConverter.xaml.cs:108-147
Keyboard Support
- Number keys - Enter values
- Decimal point - Enter decimals
- Tab - Switch between fields
- Esc - Clear current entry
- Space - Select dropdown (when focused)
src/Calculator/Views/UnitConverter.xaml.cs:100-106
Accessibility
- Screen reader support with descriptive names
- Keyboard navigation throughout
- High contrast mode compatible
- Large touch targets for mobile devices
- Clear visual feedback for all interactions
State Persistence
The converter remembers:- Last selected category
- Last used units in each category
- Previously entered values
- Network preference settings
src/CalcManager/UnitConverter.h:249-250
Visual States
Loading States
- Unit Loaded - Category is ready, conversions available
- Unit Not Loaded - Data is being fetched (currency only)
- Progress Ring - Shown after 500ms delay to avoid flashing
src/Calculator/Views/UnitConverter.xaml.cs:209-228
Error States
- Charges May Apply - Warning for metered connections
- Failed to Refresh - Network error indicator
- Offline - No network connection
src/Calculator/Views/UnitConverter.xaml.cs:254-334
Related Features
- Currency Converter - Detailed currency conversion features
- Date Calculator - Date and time calculations