InnerClass In a Separate File

Hello, Im trying to split my code in several files, One is Coupon.ux When I try to build it tells me this:

Configuring
.../MainView.ux(29): E8001: Data type not found: Coupon
.../MainView.ux(29): E8001: Could not resolve type 'Coupon'

Build completed in 3.60 seconds
    2 errors

I need this as a InnerClass because I need to access a property outside of it:

Configuring
.../Coupon.ux(4): E8001: 'MainBackgroundImage2' declared in MainView.ux(13) is a member 'MainView' and cannot be accessed from 'Coupon'. To make this work, consider making 'Coupon' an ux:InnerClass of 'MainView'.
...unoproj: E0000: Object reference not set to an instance of an object

Build completed in 3.50 seconds
    2 errors```

Is this intended?

Hi!

In order for an ux:InnerClass to work, it needs to know the context in which you are going to use it.

There are two ways to resolve this:

1 - Do an <Ux:Include File="Coupon.ux" /> in the scope where you would otherwise declare the class.

or

2 - Rewrite to a regular ux:Class and use ux:Dependency to inject the required objects.

Hope that helps!

Anders