deaddreams
Topic Author
Posts: 3
Joined: 05 Apr 2023, 13:43

Troubleshooting Design Errors in Blend for NoesisGUI within Unity

09 Sep 2023, 04:03

I'm encountering an issue with the NoesisGUI package in Unity when trying to incorporate multiple user controls into my MainWindow.xaml. The problem is that Blend is generating errors and failing to display the design and UI view, even though everything works fine in Unity. The UserControls referenced in the MainWindow open and display correctly. I'm seeking assistance on how to resolve this issue and get Blend to properly visualize my UserControls. Any guidance or insights would be greatly appreciated.

for more explain, when i create a UserControl from Tools/NoesisGuI/Create , and reference that in mainwindow.xaml , blend gives error that the UserControl does not exist but there is no any error in unity and when i run Unity the usercontrol shows properly. if i Build or rebuild the project in blend it gives more error. im creating an Web application (WebGL) with unity and there are so many panels and dynamic items in my app which i need use multiple UserControl and Pages in MainWindow. what do i do? any point of direction would be appreciated.
(also your plugin is only way that i can use vector UI in unity. please help me)
 
deaddreams
Topic Author
Posts: 3
Joined: 05 Apr 2023, 13:43

Re: Troubleshooting Design Errors in Blend for NoesisGUI within Unity

09 Sep 2023, 06:53

I resolve the errors by delete the Noesis namespace in the code behind of the UserControl. for example:
public partial class ScheduleUserControl: Noesis.UserControl

and I also fiddled with the namespaces a bit to get it right. it is little bit tricky.

and now i dont know how to make code-behind of the UserControl inherit MonoBehaviour. can i do that?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Troubleshooting Design Errors in Blend for NoesisGUI within Unity

13 Sep 2023, 20:17

for more explain, when i create a UserControl from Tools/NoesisGuI/Create , and reference that in mainwindow.xaml , blend gives error that the UserControl does not exist
If you work with a Blend project, it is better if you create all the controls directly in Blend (right-click project > Add > UserControl).
And then adapt the code-behind namespaces as explained in our Unity tutorial to make it work in both Blend and Unity.
and now i dont know how to make code-behind of the UserControl inherit MonoBehaviour. can i do that?
No, UserControls cannot inherit from MonoBehavior, but you can define a MonoBehavior as the ViewModel connected to the control. This is what we are doing in the samples included in our plugin:
public class ButtonsViewModel : MonoBehaviour
{
    void Start()
    {
        NoesisView view = GetComponent<NoesisView>();
        view.Content.DataContext = this;
    }    
    ...
}

Who is online

Users browsing this forum: No registered users and 4 guests