KeldorKatarn
Posts: 86
Joined: 30 May 2014, 10:26

Re: [Unity] Maximizing reuse with WPF: Compiling Noesis as D

31 Mar 2015, 22:02

BTW, UnityVS was acquired by Microsoft and I believe it is now free. I'm going to give it a try. (http://unityvs.com/)
I know, which was one more reason I decided to no longer use DLLs. Now that UnityVS is free it is one less obstacle for smooth Visual Studio development and the extra problems having an external DLLs are just no longer worth it in my opinion.
 
MrHayato
Posts: 36
Joined: 19 Sep 2014, 21:29

Re: [Unity] Maximizing reuse with WPF: Compiling Noesis as D

09 Apr 2015, 00:45

So our team currently does a mix of what you guys want to do. We originally tried to rip out the NoesisGUI stuff into its own DLLs but ran into the same problems most of you are having. We already build out all of our core pieces into DLLs (eg: Database downloading, SQLite queries, data models, etc) so its easily testable and doesn't depend on Unity.

However NoesisGUI views were the biggest PITA, so this is eventually what we did, and it works great! It also allows us to edit the UI using the blend editor (or built in VS editors), requires no build step, everything is still in its own separate VS project, and UnityVS debugs properly.

1) We ended up putting all of our UI and view models inside the unity project, in a UI folder. Everything in there is strictly NoesisGUI stuff.
2) We then created a VS .csproj project (a WPF project, running .NET 4.0 or 4.5, doesn't matter) in that same UI folder, and included all the files as part of that project.
3) We created a folder called _NoesisRef, and added a link to all the noesis .cs files in the Assets\Plugins\NoesisGUI\Scripts\ folder. This gives us code completion.
4) We modified the output bin/ and obj/ dirs in our .csproj file to output to .bin/ and .obj/ so that Unity will ignore those folders and not import the DLLs that are created or referenced there (since we reference our other DLLs from our UI, and we don't want duplicates). We also excluded this project from being built when we build the solution (right click solution, configuration manager, uncheck "build" for that project)
5) Then we just add that .csproj to our Visual Studio .sln solution, and voila, we can edit our UI using VS, and NoesisGUI automatically picks up those changes and builds the .xaml and .cs files for you.

We don't actually build any files using the WPF .csproj, it's purely there so its easier to manage in VS and to see design preview if needed.

After this, all our headaches went away! Even adding new files to the project will put the file in the right place in Unity!
 
JaredThirsk
Topic Author
Posts: 25
Joined: 04 Feb 2015, 23:20

Re: [Unity] Maximizing reuse with WPF: Compiling Noesis as D

18 May 2015, 22:57

So our team currently does a mix of what you guys want to do. We originally tried to rip out the NoesisGUI stuff into its own DLLs but ran into the same problems most of you are having. ...
This sounds like a great compromise! I am giving it a shot. (I have been busy for a few weeks, but just getting back to this.)

However, I am compromising a little back the other way again:

My main code injects ICommand, INotifyCollectionChanged, and I use my own IViewModel interface to manage and inject into viewmodels. so now I am trying to create a tiny DLL with just these classes (and the other MVVM ones from NoesisGUI, ones that are copied from Microsoft don't have build flags in them).

BTW, my loose ViewModel files reference my Model classes. The csproj for the loose files that doesn't get built references the DLL, and Unity finds the DLL. Wins all around!
 
schragnasher
Posts: 33
Joined: 07 Mar 2015, 01:58

Re: [Unity] Maximizing reuse with WPF: Compiling Noesis as D

19 May 2015, 14:54

Has anyone written any good tutorials on any of these setups? IV run into many annoying issues with my previews breaking because of xaml parse errors I can't get to clear because of custom noesis classes. Id like to avoid editing noesis too much because of upgrades.
 
JaredThirsk
Topic Author
Posts: 25
Joined: 04 Feb 2015, 23:20

Re: [Unity] Maximizing reuse with WPF: Compiling Noesis as D

20 May 2015, 05:14

Has anyone written any good tutorials on any of these setups? IV run into many annoying issues with my previews breaking because of xaml parse errors I can't get to clear because of custom noesis classes. Id like to avoid editing noesis too much because of upgrades.
It would be nice if this was all sorted out with definitive tutorial(s). Have you tried MrHayato's approach? I think it is the simplest compromise, with the caveats I mentioned. I will have to pull out a few files each time (MVVM/*.cs) I upgrade NoesisGUI, but it's not that bad.

Who is online

Users browsing this forum: No registered users and 1 guest