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

Cast Error #56

Closed
SezMe opened this issue Jan 29, 2022 · 3 comments
Closed

Cast Error #56

SezMe opened this issue Jan 29, 2022 · 3 comments

Comments

@SezMe
Copy link

SezMe commented Jan 29, 2022

I have a wpf window called People that has three grid columns. With one column named col0 and using this configuration:

Trackr.Configure(Of People)().Property(Function(p) p.col0.Width).PersistOn(NameOf(Window.Closing)).StopTrackingOn(NameOf(Window.Closing))

I get this error:

TRACKING: Applying tracking to property with key='Width' failed. ExceptionType:'InvalidCastException', message: 'Specified cast is not valid.'!

I'm using V2.2.11

anakic pushed a commit that referenced this issue Jan 29, 2022
…nflicts

The following situation was leading to an issue:
tracker.Configure<MyWindow>().Property(w=>w.Width).Property(w => w.gridCol1.Width)

The problem was that both properties were saved under the same name
(Width). To fix this, TrackingConfiguration now uses the entire
expression as the name of the property.

This solves issue #56
@anakic
Copy link
Owner

anakic commented Jan 29, 2022

Yeah, bug confirmed. It's caused by a naming collision, i.e. both "window.Width" and "col0.Width" properties are saved under the name "Width". You can fix it by upgrading to v2.1.12. (just published). You can also make it work in v2.1.11. by specifying a different name for the col0.width property (e.g. .Property(Function(p) p.col0.Width, "col0.Width") just to confirm that this is the cause.

@anakic
Copy link
Owner

anakic commented Jan 29, 2022

Let me know if the new version fixes the bug for you and I'll close the issue if it does.

@anakic
Copy link
Owner

anakic commented Feb 7, 2022

@SezMe is this issue resolved? Mind if I close it?

@anakic anakic closed this as completed Feb 8, 2022
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