Justei
Topic Author
Posts: 17
Joined: 28 Aug 2013, 21:03

Error loading xaml file.

28 Aug 2013, 21:47

Hi there!
I've been trying to follow the tutorials on how to set up noesis properly and get my own GUI in, and am having some trouble once I get it into Unity.

Whenever I try to use a xaml file I have made, I get the following error:
Exception: [DX9] Resource Assets/Assets/App.xaml not found

This is created in Blend, and I'm pretty much just saving it outright from there, what could I be doing wrong?
Thanks.

This is the App.xaml file:
http://pastebin.com/pKPPMdcd

This is the MainWindow.xaml file:
http://pastebin.com/hdY56Gpn

This is the Simple Styles.xaml file:
http://pastebin.com/1kdkui09
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Error loading xaml file.

28 Aug 2013, 23:06

Hi Justei,

When you create in Blend an application project it creates automatically App.xaml and MainWindow.xaml files. Those files should be ignored because both application and window are managed by Unity itself, and NoesisGUI for Unity doesn't support Application and Window classes as root of their xaml assets.

I would recommend to follow this steps to set up your project:
- Create a Unity project
- Create a Blend project outside the Assets folder of your Unity project (to avoid messing Unity with Blend .cs files)
- Then create an empty .xaml file inside Assets folder (in any subdirectory you want)
- In Blend, Projects tab, right click on your project, select the option "Link to Existing Item...", and find the .xaml file you created in the Assets folder
- Design your interface as you want but remember not to use a Window as root, I normally use a Grid, for example:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <TextBox HorizontalAlignment="Left" Height="23" Margin="77,105,0,0" Style="{DynamicResource SimpleTextBox}" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Text="username"/>
        
</Grid>
- In Unity, create a new scene, select Main Camera object in the hierarchy, and add a NoesisGUIPanel component
- In the Xaml property of the NoesisGUI Panel component select the previously created xaml
- In the Xaml property of the NoesisGUI Panel component select the Simple Styles.xaml
- Click Play button in Unity Editor.

Don't hesitate to ask again if there is anything you don't understand ;)
 
User avatar
jsantos
Site Admin
Posts: 3906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Error loading xaml file.

29 Aug 2013, 00:15

Welcome.

Our next release (end of week) will include a tutorial describing these steps. I think that you have probably read the Blend Tutorial included in the documentation that, although included in the Unity part, it is in fact a tutorial for the native SDK.

I have sent you an email with a preview of the tutorial that will be included.

Hope this helps.
 
Justei
Topic Author
Posts: 17
Joined: 28 Aug 2013, 21:03

Re: Error loading xaml file.

29 Aug 2013, 17:02

Thanks a lot for the help :) it works now! :)

Who is online

Users browsing this forum: No registered users and 69 guests