Page 1 of 1

Sharing Code Between Blend and Unity

Posted: 13 May 2024, 20:17
by burst2flame
Hi!

I'd prefer to be able to define my DataContext class in one place and use it in both unity and in the blend file. Is this possible? If so, how is this accomplished.

Re: Sharing Code Between Blend and Unity

Posted: 15 May 2024, 10:52
by sfernandez
Hi, you can share the same viewmodel (or code-behind) classes for Blend and Unity, you just need to use some conditional compilation to distinguish between the different types in WPF and Noesis/Unity. We use that approach in some of our examples, like in here: https://github.com/Noesis/Tutorials/blo ... ewModel.cs