Windowscommunitytoolkit: Expander control causes exception

Created on 14 Dec 2017  路  5Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request <!-- Please file a UserVoice request and include the link below https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit -->
[ ] Sample app request
[ ] Documentation issue or request
[ ] Question of Support request => Please do not submit support request here, instead see https://github.com/Microsoft/UWPCommunityToolkit/blob/master/contributing.md#question

UserVoice link

Current behavior

When I run the app (and also before running in the Error List) there is an error:

Method not found: 'Void Windows.UI.Xaml.Hosting.ElementCompositionPreview.SetImplicitShowAnimation(Windows.UI.Xaml.UIElement, Windows.UI.Composition.ICompositionAnimationBase)'.

Expected behavior

I expect the app runs without any exception

Minimal reproduction of the problem with instructions

https://github.com/TheSETJ/TestExpander

Environment

Nuget Package(s): 
Microsoft.Toolkit
Microsoft.Toolkit.Uwp
Microsoft.Toolkit.Uwp.UI.Controls
Microsoft.Toolkit.Uwp.UI.Animations

Package Version(s): 
2.1.0

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [x] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

App min and target version:
- [x] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 15.3
- [x] 2017 15.5

Most helpful comment

Exactly :)

All 5 comments

If you are targeting anniversary update, but your dev machine is running FCU, this is expected. The cause of this the way APIInformation (the api we use) actually works: it does not check if your app has access to an API - instead it checks if your OS has that API.

My recommendation here is to move your target version up to FCU.

I did that and the app ran correctly. But I have another question, what will happen if this app runs on another machine with Anniversary version of Windows? Will it crash? @nmetulev

It will not crash, it just won't run the implicit animations. The APIInformation call will check if the API is there and since it's AU, it won't and it will not try to use it.

@nmetulev If I'me getting it right, in Anniversary version, it will simply expand and collapse without animation and in Fall Creator version, it will use animation, right?

Exactly :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michael-hawker picture michael-hawker  路  3Comments

andriihorpenko picture andriihorpenko  路  3Comments

SmartPolarBear picture SmartPolarBear  路  4Comments

tibitoth picture tibitoth  路  3Comments

kusanagi2k2 picture kusanagi2k2  路  4Comments