Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
This objective-c code works:
but the animation sample here:
doesn't work, even as far back as XM 2.8.
I re-created it what I thought should work c#:
and it still isn't. Do we have an issue w\ the animator proxy?
I could make the sample work as expected by making one small change to the sample. Use SetValueForKey instead of SetValueForKeyPath in the setLineWidth method, e.g. replace:
> SetValueForKeyPath((NSNumber) value,(NSString)"drawnLineWidth");
> SetValueForKey((NSNumber) value,(NSString)"drawnLineWidth");
and then the line width animates as expected.
I am not sure what the correct Key Path would be, if any would work. I tried animator.drawnLineWidth but that did not change anything. But it did not throw an exception, whereas Animator.drawnLineWidth threw a native exception, understandably since that definitely does not exist.
So I will not change the status of this bug report in case this should work with a KeyPath.
This looks like it's just the bug of needing to use Key instead of KeyPath that has already been fixed, not a bug in our bindings for KeyPath. After reviewing Chris' working objective-c sample, it's not using setValue:forKey: OR setValue:forKeyPath:, it's simply setting [self animator].DrawnLineWidth directly. If I change the objective-c to call:
[[self animator] setValue:[[NSNumber alloc] initWithInt:(int)([self.DrawnLineWidth integerValue] + 10)] forKeyPath:@"drawnLineWidth"];
I get the same behaviour as in the C# sample (no animation), but using
[[self animator] setValue:[[NSNumber alloc] initWithInt:(int)([self.DrawnLineWidth integerValue] + 10)] forKey:@"drawnLineWidth"];