Skip to content
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

Binding manager tests failing on initialize and on the handle property change tests #15

Open
ATECoder opened this issue Aug 4, 2023 · 5 comments

Comments

@ATECoder
Copy link

ATECoder commented Aug 4, 2023

Thank you for this interesting project. I am trying to see if I can use this to implement a bit of MVVM in Excel. I saw your indication that this is super experimental.

I am getting a type mismatch error on this statement:

Set Test.ConcreteSUT = BindingManager.Create(Test.CommandManager, New StringFormatterNetFactory)

which I changed to:

Set Test.ConcreteSUT = BindingManager.Create(AppContext.Create(DebugOutput:=True), New StringFormatterNetFactory)

I am wondering if this change is insufficient and thus causing the handle property change tests to see 0 invokes.

Could you please suggest some ideas of how I could fix this?

Thanks

David

@Greedquest
Copy link

Greedquest commented Aug 4, 2023

I have used the mvvm library successfully - e.g.:

https://codereview.stackexchange.com/q/265793/146810

So I'm wondering if it is an essential part that is not working, or are you trying to run the unit tests which I guess are an added bonus

What I'm getting at is maybe you can ignore this error and everything will still work?

Edit: just noticed my code review post was closed from inactivity :'( here is the example workbook where I have things working https://github.com/Greedquest/CodeReviewFiles/blob/master/MVVM_Comparer.xlsm

@Greedquest
Copy link

image

Ah I see you are running the unit tests and seeing this. I'm confused because AppContext.Create needs the IBindingManager, and BindingManager.Create needs the IAppContext. Looking at it I cannot work out how to disentangle.

@ATECoder
Copy link
Author

ATECoder commented Aug 4, 2023 via email

@Greedquest
Copy link

Well for what it's worth the plan as I understand it is to reimplement this framework in twinBASIC as a compiled dll which you would then reference from VBA. The tests will likely have to be partly rewritten at that point - so I doubt you will see them fixed in the VBA form.

Sorry about the broken code review post. It points to this spreadsheet Greedquest/CodeReviewFiles@master/MVVM_Comparer.xlsm where I have used MVVM to implement a userform that allows you to sort a list by selecting between 2 items (i.e. which is "greater" than the other)

image

It's just another demo to show how to use MVVM in practice. Very simple use case. I can resurrect the code from the CR post but it sounds like you have made some progress of your own so I don't know how useful you'll find it.

@ATECoder
Copy link
Author

ATECoder commented Aug 4, 2023 via email

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

No branches or pull requests

2 participants