# InnerClass In a Separate File

**URL:** <https://forums.fusetools.com/t/innerclass-in-a-separate-file/3169>\
**Category:** General\
**Created:** [September 1, 2016, 4:42am UTC](https://forums.fusetools.com/t/innerclass-in-a-separate-file/3169 "2016-09-01T04:42:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erick\_Tamayo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/erick_tamayo/32/527_2.png) [@Erick\_Tamayo](https://forums.fusetools.com/u/Erick_Tamayo)\
**Post date:** [September 1, 2016, 4:42am UTC](https://forums.fusetools.com/t/innerclass-in-a-separate-file/3169/1 "2016-09-01T04:42:03Z")

</div>

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

```auto
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:

````auto
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?
````

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 1, 2016, 7:30am UTC](https://forums.fusetools.com/t/innerclass-in-a-separate-file/3169/2 "2016-09-01T07:30:06Z")

</div>

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
