JayOfAllTrades
Topic Author
Posts: 7
Joined: 10 Mar 2022, 21:43

Binding to TimeSpan

29 Jul 2023, 05:09

I'll be brief because I know you guys are flooded with help requests.

Inside my view model I expose a TimeSpan for an in-game countdown timer. I created three text blocks which bind to the TimeSpan.Minutes, Seconds, and Milliseconds. In Wpf it works, but in Unity I get this error.

[NOESIS/W] Can't solve PropertyPath: Type 'TimeSpan' does not contain a property named 'Minutes'
[NOESIS/E] Binding failed: Path=Time.Minutes, Source=Testing.TimerTestViewModel(''), Target=TextBlock('')


I got identical errors for the seconds and the milliseconds. The xaml for the textblock is simply:
<TextBlock Text="{Binding Time.Minutes}"/>
This is the second time I've had an issue identical to this, so this time I'm reaching out so that I can find out what I'm doing wrong and avoid this mistake in the future.
 
User avatar
sfernandez
Site Admin
Posts: 3008
Joined: 22 Dec 2011, 19:20

Re: Binding to TimeSpan

31 Jul 2023, 14:09

Hi, we are not exposing those members in our native TimeSpan, could you please report it in our bugtracker? We will add it for the next release.
 
JayOfAllTrades
Topic Author
Posts: 7
Joined: 10 Mar 2022, 21:43

Re: Binding to TimeSpan

31 Jul 2023, 21:43

Done! :) #2657

Also, is there any way I can verify implementation details like that in the future should I run into this problem again? The docs looked like they showed TimeSpan as having these properties when I had checked. Is that just a small mistake on the docs, or did I misreading it?
 
User avatar
sfernandez
Site Admin
Posts: 3008
Joined: 22 Dec 2011, 19:20

Re: Binding to TimeSpan

01 Aug 2023, 11:45

Thanks for the report!
Also, is there any way I can verify implementation details like that in the future should I run into this problem again? The docs looked like they showed TimeSpan as having these properties when I had checked. Is that just a small mistake on the docs, or did I misreading it?
The docs should be the correct source of reference, this was just a bug in our code.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests