Issue With Custom views in NoesisGUI
Posted: 13 Nov 2020, 03:46
Hello guys, I recently have installed the Noesis plugin for Unity and I'm trying to create and load a smaple view. I have created a separate WPF project and created a very basic view. I have dragged both the MainWindow.xaml view and the MainWindow.xaml.cs file over to my Unity project but I get errors when I load in the files and set the view. I was wondering how I could fix this issue.
Here is a screenshot of the errors I get when trying to load in the views:
https://ibb.co/mJ3SvtY
This is the code I have for both the xaml and the xaml.cs respectively:
MainWindow.xaml
MainWindow.xaml.cs
Any help on this would be greatly appreciated.
-Joshmond
Here is a screenshot of the errors I get when trying to load in the views:
https://ibb.co/mJ3SvtY
This is the code I have for both the xaml and the xaml.cs respectively:
MainWindow.xaml
Code: Select all
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="Hello NoesisGUI" Height="450" Width="800">
<Grid>
<TextBlock FontSize="60" HorizontalAlignment="Center" VerticalAlignment="Center">Hello World</TextBlock>
</Grid>
</Window>
Code: Select all
#if UNITY_5_3_OR_NEWER
#define NOESIS
using Noesis;
#else
using System;
using System.Windows;
using System.Windows.Controls;
#endif
namespace WpfApp1
{
/// <summary>
/// Interaction logic for MainWindowxaml.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
#if NOESIS
private void InitializeComponent()
{
Noesis.GUI.LoadComponent(this, "Assets/MainWindow.xaml");
}
#endif
}
}
-Joshmond