Windowscommunitytoolkit: XAML Designer Issues when using controls that rely on composition APIs

Created on 14 Dec 2016  路  19Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

To reproduce the issue:

  1. Using latest VS 2017 RC https://www.visualstudio.com/vs/visual-studio-2017-rc/
  2. Create a new C# UWP project
  3. Add reference to Microsoft.Toolkit.UWP.UI.Controls
  4. Add a DropShadowPanel to MainPage's grid (and set the Image Source to any image)

MissingMethodException is reported.
at Microsoft.Toolkit.Uwp.UI.Controls.DropShadowPanel.UpdateShadowSize()
at Microsoft.Toolkit.Uwp.UI.Controls.DropShadowPanel.CompositionShadow_SizeChanged(Object sender, SizeChangedEventArgs e)

bug

Most helpful comment

For RadialGauge, the designer "loads" in VS 2017 (as in I don't see a crash) but nothing is rendered. I get a warning on the control saying the "Method not found: 'Void.Windows.UI.Composition.Visual.put_Size(System.Numerics.Vector2)'.
radialgauge

In VS 2015 I see different behavior but they seem related:
radialgaugevs2015

All 19 comments

We know they are still issue with Vs2017 RC.
can you try with vs2015?

Still see the designer crash, but the exception is "BadImageFormatException: Cannot load a reference assembly for execution." with no StackTrace. The app runs as expected.
shadowpanelbug

Also DropShadowPanel (Image in Grid) causes performance issue for me. My app doesn't crash but can't use it properly.

Does it do the same with another composition control (like Gauge for instance?)

For performance issue, are you using it on a big image?

For RadialGauge, the designer "loads" in VS 2017 (as in I don't see a crash) but nothing is rendered. I get a warning on the control saying the "Method not found: 'Void.Windows.UI.Composition.Visual.put_Size(System.Numerics.Vector2)'.
radialgauge

In VS 2015 I see different behavior but they seem related:
radialgaugevs2015

I think the design time experience can be improved by wrapping problematic code (especially composition) into design time checks using the Windows.ApplicationModel.DesignModew.DesignModeEnabled API. In other words, only execute code that causes design time issues if the process is not running in design mode (determined by the API).

Edit: I've updated the title of the issue as it likely extends beyond just "DropShadowPanel" - any control that relies on composition will probably be affected.

Agree. This is something we are doing for Gauge already.

Stupid me...I merged directly on dev..Sorry about that.

I don't use big image but lots of image in same page like +120 images.

I guess this is the reason why

Does https://github.com/Microsoft/UWPCommunityToolkit/commit/541dfc3d95a52c1782401b8c1854a5cb05d8b7f9 should fix the issue for DropShadowPanel - are there other controls that will encounter this?

It should. You can test it with this repo:
https://dotnet.myget.org/F/uwpcommunitytoolkit/api/v3/index.json

We should not having other controls (hopefully)

I still get the same error using RadialGauge in VS2017 (Microsoft.Toolkit.Uwp.UI.Controls 1.4.1).
Is there a fix for RadialGauge too?

Like @mrueedi , I also experience the same issue in VS2017. Would love to see an update on this issue.

It must be too hard for the developers to solve

@jefhai, are you having the same issue? 2.0 had a lot of fixes for the designer

@nmetulev is this a no fix for 1.0? We can't currently upgrade to 2.0 and benefit from this.

Unfortunately there is not, bug fixes move forward with each version.

Just curious, why are you not able to update to 2.0?

Was this page helpful?
0 / 5 - 0 ratings