-
- picpic2006
- Posts: 71
- Joined:
Noesis.Extended ?
Hello,
i didn't use noesis since a while, i really missing something new here.
I just try to bind a text property from a usercontrol to a textblock in xaml
I did that lot of times before, but now it doesn't work any more !
It appear you change the code to accomplish it can you tell me more about the new method.
xaml
c#
Sorry if the question seem so stupid !
i didn't use noesis since a while, i really missing something new here.
I just try to bind a text property from a usercontrol to a textblock in xaml
I did that lot of times before, but now it doesn't work any more !
It appear you change the code to accomplish it can you tell me more about the new method.
xaml
Code: Select all
<Grid x:Name="LayoutRoot" TextElement.FontFamily="../Fonts/#Arial">
<Rectangle Fill="#FFF4F4F5" Stroke="Black"/>
<StackPanel Margin="172.967,107" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="Labeltxt" Text="{Binding ElementName=root, Path=Text}" TextWrapping="Wrap" FontSize="32" Margin="0,0,-0.001,0" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Black"/>
<Button x:Name="AnnulerBtn" Content="Annuler" Style="{DynamicResource RedBtn}" VerticalAlignment="Top" FontSize="24" FontWeight="Bold" Foreground="White" Margin="0,5,0,0" Height="80"/>
<Button x:Name="ValiderBtn" Content="Valider" Style="{DynamicResource GreenBtn}" FontSize="24" FontWeight="Bold" Foreground="White" Margin="0,5,0,0" Height="80"/>
</StackPanel>
</Grid>
Code: Select all
using Noesis;
using System;
using UnityEngine;
[Noesis.UserControlSource("Assets/Gui/UserControls/PopUp.xaml")]
public class PopUpControl : UserControl
{
public DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string),
typeof(PopUpControl), new PropertyMetadata(""));
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
private Button Annulerbtn;
private Button.ClickHandler annulerEventHandler;
public Button.ClickHandler AnnulerEventHandler
{
set
{
annulerEventHandler = value;
if (Annulerbtn != null)
{
Annulerbtn.Click += annulerEventHandler;
}
}
}
private Button Validerbtn;
private Button.ClickHandler validerEventHandler;
public Button.ClickHandler ValiderEventHandler
{
set
{
validerEventHandler = value;
if (Validerbtn != null)
{
Validerbtn.Click += validerEventHandler;
}
}
}
public void OnPostInit()
{
Validerbtn = (Button)FindName("ValiderBtn");
Annulerbtn = (Button)FindName("AnnulerBtn");
Annulerbtn.Click += annulerEventHandler;
Validerbtn.Click += validerEventHandler;
}
}
Code: Select all
Exception: System.ApplicationException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: DependencyProperty 'Text' already registered to type 'PopUpControl'
at Noesis.Error.Check () [0x00020] in F:\2015_Affaire_Anthony\15_XXX Edf_Borne\Engine\Opinio\Assets\Plugins\NoesisGUI\Scripts\Core\NoesisError.cs:21
at Noesis.DependencyProperty.Noesis_RegisterDependencyProperty_String_ (IntPtr classType, IntPtr propertyName, IntPtr propertyMetada
Noesis.Error.Check () (at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisError.cs:21)
Noesis.UIRenderer.Noesis_MouseButtonUp (Int32 rendererId, Single x, Single y, Int32 button) (at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisUIRendererImports.cs:202)
Noesis.UIRenderer.ProcessEvent (UnityEngine.Event ev, Boolean enableKeyboard, Boolean enableMouse) (at Assets/Plugins/NoesisGUI/Scripts/Core/NoesisUIRenderer.cs:417)
NoesisGUIPanel.OnGUI () (at Assets/Plugins/NoesisGUI/Scripts/NoesisGUIPanel.cs:448)
-
- picpic2006
- Posts: 71
- Joined:
Re: Noesis.Extended ?
Hello again,
i have an other question i try to build for windows 8 store with out succes, i try to build, i have an error
in VS
I'm in the last release of unity 5.1.2
if i build with sdk8.1 not universal every thing work fine but when i compile in VS i have not click or input to my gui !
Any idee
Thanks a lot
Any idee
i have an other question i try to build for windows 8 store with out succes, i try to build, i have an error
Code: Select all
Failed to patch file
UnityEngine.Debug:LogError(Object)
NoesisBuildPostprocessor:OnPostprocessBuildWSA(String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:36)
NoesisBuildPostprocessor:OnPostprocessBuild(BuildTarget, String) (at Assets/Editor/NoesisGUI/NoesisBuildPostprocessor.cs:14)
UnityEditor.HostView:OnGUI()
Code: Select all
Exception de première chance à 0x76174598 dans Template.exe : exception Microsoft C++ : Platform::FailureException ^ à l'emplacement de mémoire 0x0A0FC8BC. HRESULT:0x80004005 Erreur non spécifiée
Informations WinRT : NoesisError: NoesisUnityRenderHook library was not initialized
Trace de la pile :
[Code externe]
Noesis.dll!15583b16()
Noesis.dll!15583a62()
[Code externe]
if i build with sdk8.1 not universal every thing work fine but when i compile in VS i have not click or input to my gui !
Any idee
Thanks a lot
Any idee
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Noesis.Extended ?
This error appears because you are defining the Text DependencyProperty as an instance field instead of static, so every time an instance of your PopUpControl is created, the Text property is registered again in the native type.System.Exception: DependencyProperty 'Text' already registered to type 'PopUpControl'
You have to change your UserControl code to:
Code: Select all
using Noesis;
using System;
using UnityEngine;
[Noesis.UserControlSource("Assets/Gui/UserControls/PopUp.xaml")]
public class PopUpControl : UserControl
{
public static DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(PopUpControl), new PropertyMetadata(""));
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
private Button Annulerbtn;
private Button.ClickHandler annulerEventHandler;
public Button.ClickHandler AnnulerEventHandler
{
set
{
annulerEventHandler = value;
if (Annulerbtn != null)
{
Annulerbtn.Click += annulerEventHandler;
}
}
}
private Button Validerbtn;
private Button.ClickHandler validerEventHandler;
public Button.ClickHandler ValiderEventHandler
{
set
{
validerEventHandler = value;
if (Validerbtn != null)
{
Validerbtn.Click += validerEventHandler;
}
}
}
public void OnPostInit()
{
Validerbtn = (Button)FindName("ValiderBtn");
Annulerbtn = (Button)FindName("AnnulerBtn");
Annulerbtn.Click += annulerEventHandler;
Validerbtn.Click += validerEventHandler;
}
}-
- picpic2006
- Posts: 71
- Joined:
Re: Noesis.Extended ?
great thanks you
So i just take the exemple in the databinding tutorial sorry what is the difference between ?
For the windows store build i should do something wrong but i can't see any todo in your documentation.
So i just take the exemple in the databinding tutorial sorry what is the difference between ?
For the windows store build i should do something wrong but i can't see any todo in your documentation.
Code: Select all
class View2: UserControl
{
public DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string),
typeof(View2), new PropertyMetadata(""));
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
}
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Noesis.Extended ?
The C# code in that sample of the documentation is wrong, it should be a static field.
Sorry for the inconveniences
I just fixed it, thanks.
Sorry for the inconveniences
I just fixed it, thanks.
-
- picpic2006
- Posts: 71
- Joined:
Re: Noesis.Extended ?
Great
i really tinking i'm crazzy !
*I saw in your documentation, that in unity 5.1 we don't have to had the reference :
Noesis.dll and NoesisUnityRenderHook.dll
to the reference of the VS project.
I'm in 5.1.2 so i did nothing but when i open my project i can't see noesis.dll in the references, is it correct ?
Thanks you
i really tinking i'm crazzy !
*I saw in your documentation, that in unity 5.1 we don't have to had the reference :
Noesis.dll and NoesisUnityRenderHook.dll
to the reference of the VS project.
I'm in 5.1.2 so i did nothing but when i open my project i can't see noesis.dll in the references, is it correct ?
Thanks you
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Noesis.Extended ?
Yes, it is correct. That .dll is a native library, so you don't need to have a reference to that dll in your VS project.I'm in 5.1.2 so i did nothing but when i open my project i can't see noesis.dll in the references, is it correct ?
But you can check that all our scripts under Plugins are included in the firstpass assembly project, so they will be compiled and could be used by your application scripts.
Who is online
Users browsing this forum: No registered users and 3 guests