Sample noesis test with simple button
Posted: 22 Mar 2020, 16:31
Hi,
I'm a beginner in noesis. I'm trying to run this c#-code and unity3d below. It's a sample from the noesis dokumentation.
It throws this error:
InvalidCastException: Specified cast is not valid.
test.Start () (at Assets/Test01/test.cs:12)
I added Noesis to use Noesis.Grid.
Whats wrong with this cast? Hope anybody can help me.
I'm a beginner in noesis. I'm trying to run this c#-code and unity3d below. It's a sample from the noesis dokumentation.
It throws this error:
InvalidCastException: Specified cast is not valid.
test.Start () (at Assets/Test01/test.cs:12)
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Noesis;
public class test : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Noesis.Grid root = (Noesis.Grid) Noesis.GUI.LoadXaml("Assets/Test01/test.xaml"); // <<< throws error
Button button = (Button)root.FindName("button");
button.Click += (object sender, RoutedEventArgs args) =>
{
System.Console.WriteLine("Button was clicked");
};
}
// Update is called once per frame
void Update()
{
}
}
Whats wrong with this cast? Hope anybody can help me.