-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Financial Calculator #22
base: finance
Are you sure you want to change the base?
Conversation
Early spec
@joseartrivera? @sanderl? What do you think? |
Hi @Chips1234, Thanks so much for writing the spec for Financial Calculator. @grochocki will be able to answer your questions about the spec. He is pretty busy so it may take a bit for him to get back to you. |
@EriWong could you take a look? And possibly the other pr's (they've been inactive for a while now) thanks! |
@Chips1234 Sorry for the delay. I'll see if I can bring this up with for our next set of feature pitch reviews. If there's anything we find that you need to add to this, we'll let you know. As an aside, if you are working on a code sample and have questions about implementations, if you share with us your repo/branch information, we can probably more easily help you out in figuring out what's happening (with your conversion or with other things as well). |
Thanks!
You can look at my branch here. Thanks again! |
@Chips1234 I think I figured out the converter issue you encountered and it's a tricky one. So I don't think m_FinanceCalcViewModel is actually getting set when navigating. As a result, I'm not exactly sure what the view is bound to... At any rate, I instatiated that, and am now hitting an error where IsCompound is not defined in your viewmodel. This now makes more sense as I think you're casing in the viewmodel has it as isCompound. After fixing that, everything seems to work. |
Ah, okay. Thank you! |
@EriWong Sorry to bother your weekend but I still do not quite understand. Could you maybe share with me the code that you have? Thank you. |
@Chips1234 Sorry if I wasn't super clear. Take a look at ApplicationViewModel::OnModeChanged() (around line 126 in ApplicationViewModel.cpp). In there, there is an if block around NavCategory::IsCalculatorViewMode(m_mode). Looking at the code there, we get the following check:
The IsModeInCategoryGroup call is returning true. This is because your calculator type is marked as Calculator (as opposed to converter or something else). As such, this thinks you want to bind a standard calculator viewmodel to your financial calculator. It looks like date calculation and graphing calculator modes also fall into this pattern, hence the somewhat awkward if statement above. A short term fix would be to add financial calculator to the IsCalculatorViewMode check (that's what date and graphing modes did). Longer term, we may want to clean this up to something a little clearer, but that's probably outside the scope of this change. |
@EriWong Ah, okay. I understand now. How about the switch from compound interest calculation mode and tip calculation? Thanks
…________________________________
From: Eric Wong <notifications@github.com>
Sent: Monday, August 17, 2020 3:47:12 PM
To: microsoft/calculator-specs <calculator-specs@noreply.github.com>
Cc: Eric Tian <tian.eric@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [microsoft/calculator-specs] Financial Calculator (#22)
@Chips1234<https://github.com/Chips1234> Sorry if I wasn't super clear. Take a look at ApplicationViewModel::OnModeChanged() (around line 126 in ApplicationViewModel.cpp).
In there, there is an if block around NavCategory::IsCalculatorViewMode(m_mode). Looking at the code there, we get the following check:
bool NavCategory::IsCalculatorViewMode(ViewMode mode)
{
// Historically, Calculator modes are Standard, Scientific, and Programmer.
return !IsDateCalculatorViewMode(mode) && !IsGraphingCalculatorViewMode(mode) && IsModeInCategoryGroup(mode, CategoryGroupType::Calculator);
}
The IsModeInCategoryGroup call is returning true. This is because your calculator type is marked as Calculator (as opposed to converter or something else). As such, this thinks you want to bind a standard calculator viewmodel to your financial calculator. It looks like date calculation and graphing calculator modes also fall into this pattern, hence the somewhat awkward if statement above.
A short term fix would be to add financial calculator to the IsCalculatorViewMode check (that's what date and graphing modes did). Longer term, we may want to clean this up to something a little clearer, but that's probably outside the scope of this change.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALKX3RTLVW4I7JIRIAAFG7DSBGXPBANCNFSM4OXQYOSQ>.
|
@Chips1234 Once you populate m_FinanceCalcViewModel correctly, switching between tip and interest modes should work. The issues you were seeing were due to m_FinanceCalcViewModel not being correctly initialized. |
Ok, thanks
…________________________________
From: Eric Wong <notifications@github.com>
Sent: Monday, August 17, 2020 4:43:33 PM
To: microsoft/calculator-specs <calculator-specs@noreply.github.com>
Cc: Eric Tian <tian.eric@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [microsoft/calculator-specs] Financial Calculator (#22)
@Chips1234<https://github.com/Chips1234> Once you populate m_FinanceCalcViewModel correctly, switching between tip and interest modes should work. The issues you were seeing were due to m_FinanceCalcViewModel not being correctly initialized.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#22 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALKX3RU5ZMB7HF4JKK4VN2LSBG6CLANCNFSM4OXQYOSQ>.
|
@grochocki any more suggestions? |
@Chips1234 apologies for the delay. With respect to reflow, it's probably worth looking at how other pages handle reflow. If you take a look at Calculator.xaml and take a look at <VisualStateGroup x:Name="LayoutVisualStates" ...> You can see how we handle it there. |
Hello @EriWong, if I have three options in the ComboBox (for example, I add the "Simple Interest" option), what would be a good way to show/hide the grids? Thank you. |
NumberBoxes or TextBoxes? |
@mdtauk, I am using NumberBoxes. |
If space becomes tight, you could switch the Number of spin buttons between inline and compact |
@mdtauk, Thank you for your tips. I'll do that. |
Financial Calculator
Feature Pitch Link: microsoft/calculator#806