No implicit cast from Fuse.Reactive.Case

I just updated to Fuse version 0.32.0 (build 9613) and I’m receiving errors below when building, or previewing locally or on Android. I have no idea what is wrong with my code. I had the same problem with Fuse 0.30 (build 8529). I’m using Windows 8.

C:\Users\holvan\Documents\Fuse\holvan-mobile\build\Android\Preview\cache\ux11\Holvan.unoproj.g.uno(50.66): E2047: No implicit cast from Fuse.Reactive.Case to Uno.UX.PropertyObject

C:\Users\holvan\Documents\Fuse\holvan-mobile\build\Android\Preview\cache\ux11\Holvan.unoproj.g.uno(50,67,50,73): Error E2047: No implicit cast from Fuse.Reactive.Case to Uno.UX.PropertyObject

Here is a snippet from the Holvan.unoproj.g.uno file.

46  sealed class Holvan_FuseReactiveCase_String_Property: Uno.UX.Property<string>
48  {
49      [Uno.WeakReference] readonly Fuse.Reactive.Case _obj;
50      public Holvan_FuseReactiveCase_String_Property(Fuse.Reactive.Case obj, global::Uno.UX.Selector name) : base(name) { _obj = obj; }
51      public override global::Uno.UX.PropertyObject Object { get { return _obj; } }
52      public override string Get() { return _obj.String; }
53      public override void Set(string v, global::Uno.UX.IPropertyListener origin) { _obj.String = v; }
54      public override bool SupportsOriginSetter { get { return false; } }
55  }
56  sealed class Holvan_FuseControlsMultiLayoutPanel_LayoutElement_Property: Uno.UX.Property<Fuse.Elements.Element>
57  {
58      [Uno.WeakReference] readonly Fuse.Controls.MultiLayoutPanel _obj;
59      public Holvan_FuseControlsMultiLayoutPanel_LayoutElement_Property(Fuse.Controls.MultiLayoutPanel obj, global::Uno.UX.Selector name) : base(name) { _obj = obj; }
60      public override global::Uno.UX.PropertyObject Object { get { return _obj; } }
61      public override Fuse.Elements.Element Get() { return _obj.LayoutElement; }
62      public override void Set(Fuse.Elements.Element v, global::Uno.UX.IPropertyListener origin) { _obj.LayoutElement = v; }
63      public override bool SupportsOriginSetter { get { return false; } }
}
64  sealed class Holvan_FuseElementsElement_Visibility_Property: Uno.UX.Property<Fuse.Elements.Visibility>
65  {
66      [Uno.WeakReference] readonly Fuse.Elements.Element _obj;
67      public Holvan_FuseElementsElement_Visibility_Property(Fuse.Elements.Element obj, global::Uno.UX.Selector name) : base(name) { _obj = obj; }
68      public override global::Uno.UX.PropertyObject Object { get { return _obj; } }
69      public override Fuse.Elements.Visibility Get() { return _obj.Visibility; }
70      public override void Set(Fuse.Elements.Visibility v, global::Uno.UX.IPropertyListener origin) { _obj.SetVisibility(v, origin); }
71      public override bool SupportsOriginSetter { get { return true; } }
72  }
73  sealed class Holvan_FuseElementsElement_Height_Property: Uno.UX.Property<Uno.UX.Size>
74  {
75      [Uno.WeakReference] readonly Fuse.Elements.Element _obj;
76      public Holvan_FuseElementsElement_Height_Property(Fuse.Elements.Element obj, global::Uno.UX.Selector name) : base(name) { _obj = obj; }
77      public override global::Uno.UX.PropertyObject Object { get { return _obj; } }
78      public override Uno.UX.Size Get() { return _obj.Height; }
79      public override void Set(Uno.UX.Size v, global::Uno.UX.IPropertyListener origin) { _obj.Height = v; }
80      public override bool SupportsOriginSetter { get { return false; } }
81  }

Did you remember to run uno clean on your project after you updated Fuse?

Yes.

Are you trying to do <Case Value="{..}" /> ? The case values must be constant.

Can you please provide the UX code in question?

I am not using any code like that at all. That is why I am lost. I’ve also put in a request for premium support, but I have not seen a response yet. It’s been several days.

Can you please upload a project that reproduces the error here?

(secure upload that goes directly to us)

Premium support requests are not processed on weekends, but I’m sure you’ll hear back soon.

I sent the premium support request on the contact form on Thursday. If you could have the team look into that request, I would appreciate it. I take back my use of the Case class. I am using it. The problem appears to be in this code block:

    <Each Items="{playlist}">
        <Panel>
            <Match Value="{fileName}">
                <Case String="{Property this.FileName}">
                    <Rectangle ux:Name="SelectedRectangle" Fill="#1976d2"  Height="80" CornerRadius="2" Opacity="0">
                        <WhileActive>
                            <Change Duration=".3" SelectedRectangle.Opacity="1" />
                        </WhileActive>
                        <ExitingAnimation>
                            <Change Duration=".3" SelectedRectangle.Opacity="0" />
                        </ExitingAnimation>
                        <StackPanel  ContentAlignment="VerticalCenter">
                            <Text TextWrapping="Wrap" Value="{Property this.Title}"  Padding="15,15,15,10" TextColor="#fff" FontSize="20" TextAlignment="Center"/>
                            <Text TextWrapping="Wrap" Value="{Property this.Subtitle}"  TextColor="#8fc1f0" Padding="15,0,15,15" FontSize="18" TextAlignment="Center"/>
                        </StackPanel>
                    </Rectangle>
                </Case>
            </Match>
        </Panel>
    </Each>```

this.FileName is passed in from a parent ux element. If I change  ```<Case String="{Property this.FileName}">``` to ```<Case String="word">``` the project will build, but the program logic is completely broken.

What this code block accomplishes is to highlight all buttons that have already been clicked and added to the playlist from the master list of items.

This was working on Fuse 0.9.10 Build 5788 before we went to 0.32 Build 9613.

Thanks for your help.

A lot has happened between 0.9 and 0.32, and a few things are not backwards compatible.

As I wrote above, you can’t use bindings on Case Value="{..}" unfortunately. However, looks like you just want to compare values.

What about instead of <Match><Case>, try:

 <WhileTrue Value="{filename} == {Property this.FileName}">

Thanks Anders; that worked.

Now I am dealing with another problem. When I try to preview the app with a tethered tablet, the app compiles fine, but throws an error while loading. The error is “Dictionary already contains the given key.” I think it has something to do with the layout since the layout goofy now. I’m digging through it.

I/SurfaceView(21582): updateWindow -- setFrame, this = android.view.SurfaceView{3aa9017a V.E..... ......ID 0,0-1920,1200}
I/SurfaceView(21582): updateWindow -- OnPreDrawListener, mHaveFrame = true, this = android.view.SurfaceView{3aa9017a V.E..... ......ID 0,0-1920,1200}
I/Holvan  (21582): Uno.Exception: Dictionary already contains the given key
I/Holvan  (21582):    at Uno.Collections.Dictionary`2.Add(TKey,TValue)
I/Holvan  (21582):    at Outracks.Simulator.Runtime.Environment.Bind(Outracks.Simulator.Bytecode.Variable,object)
I/Holvan  (21582):    at Outracks.Simulator.Runtime.ScopeClosure.Execute(Outracks.Simulator.Bytecode.Lambda,object[])

Further down in the log I’m seeing this message too:

I/Holvan  (21582):    at Outracks.Simulator.Application.OnUpdate()
I/Holvan  (21582):    at Fuse.App.OnFrameCallback(double,double)
I/Choreographer(21582): Skipped 78 frames!  The application may be doing too much work on its main thread.
D/MALI    (21582): MTK_CheckAppName:68: appName=com.holvan.medication, acAppName=com.android.gallery3d
D/MALI    (21582): MTK_CheckAppName:74: 0
D/MALI    (21582): MTK_CheckAppName:68: appName=com.holvan.medication, acAppName=com.android.gallery3d
D/MALI    (21582): MTK_CheckAppName:74: 0

Hi, there is not much to go on here, we’ll need you to upload a project that reproduces the error.

Also, when changing topics, please start a new thread. This thread is now closed.

I just went back to Fuse version 0.12.4 (build 6406) and reserved all the changes I made to get the newer version of Fuse to work. Everything work again now.