Page 1 of 1

Resource/Image path

Posted: 09 Feb 2015, 22:50
by Genom
Hi guys, anyd idea how not to end with neverending "../../../" ?
<Grid Width="100" Height="100">
    <Image Grid.Column="1" Source="../../../../../../Images/Carta/CameraIcon.png"></Image>
Of course, I've tried just "./" and "~/" but no success :/


Re: Resource/Image path

Posted: 10 Feb 2015, 20:48
by jsantos
What do you exactly mean? We support two kind of URIs (compatible with WPF): absolute and relative.

By default, a relative pack URI is considered relative to the location of the XAML that contains the reference. For example:
<Image Source="Images/icon.png" />
Absolute URIs are considered relative to the root of the project (.csproj) indicated. For example:
<Image Source="/Sample;component/Images/icon.png" />
In this example, the Images folder must be located next to the project file, Sample.csproj in this case.

Re: Resource/Image path

Posted: 10 Feb 2015, 20:50
by jsantos
This is explained a bit better in the v1.2 documentation: Gui.Core.URIs.html (cannot link to it because v1.2 documentation is yet not online)

Re: Resource/Image path

Posted: 10 Feb 2015, 23:02
by Genom
Hi, it is still not working for me

nor this:
<Image Source="/UnityVS.PruebaXamlUnity.CSharp;component/Images/Common/logo.png" />
with error:
Unable to open C:/WinDevelopment/Pruebas/PruebaXamlUnity/PruebaXamlUnity/Assets/Libraries/IOrder.Lib.UI/Views/Assets

neither these others
<Image Source="/UnityVS.PruebaXamlUnity.CSharp;component/Assets/Images/Common/logo.png" />

<Image Source="/PruebaXamlUnity.CSharp;component/Images/Common/logo.png" />
<Image Source="/PruebaXamlUnity;component/Images/Common/logo.png" />
<Image Source="Assets/Images/Common/logo.png" />


Re: Resource/Image path

Posted: 11 Feb 2015, 18:00
by sfernandez
Hi Genom,

By the error message you are getting I guess you are working with 1.1 version, right?
Unfortunately, in that version your only option when referencing resources from other folder branch is to use "../".

The "/Sample;component/Images/icon.png" option that is more appropriate for what you are looking for, is only working as explained by jsantos, in 1.2 version.

Re: Resource/Image path

Posted: 11 Feb 2015, 18:04
by Genom
Ok, this about 1.2 I wasn't sure.