Skip to content

Conversation

tian-lt
Copy link
Contributor

@tian-lt tian-lt commented Sep 19, 2025

Root cause

The types for width and height saved in local settings is not matched universally for all the reads and writes. This leads to a type casting failure which blocks the logics to toggle the AOT mode.

Fix

Change the signature of function ToggleAlwaysOnTop from Task (float, float) to Task (double, double)

@tian-lt tian-lt requested a review from Copilot September 19, 2025 04:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a type mismatch issue in the always-on-top (AOT) mode functionality that was preventing the feature from working correctly due to inconsistent type casting between float and double values.

  • Changed the ToggleAlwaysOnTop method signature to accept double parameters instead of float
  • Removed unnecessary type casting when calling the method
  • Updated internal type casting to use double consistently

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Calculator/Views/MainPage.xaml.cs Removed explicit float casting when calling ToggleAlwaysOnTop method
src/Calculator.ManagedViewModels/ApplicationViewModel.cs Updated method signature and internal casting to use double consistently

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tian-lt tian-lt merged commit e5958aa into microsoft:main Sep 19, 2025
5 checks passed
@tian-lt tian-lt deleted the fixaot branch September 19, 2025 07:27
tian-lt added a commit to tian-lt/calculator that referenced this pull request Sep 19, 2025
tian-lt added a commit that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants