Sharing platform specific code - FrameworkElement #10662
Replies: 3 comments 6 replies
-
This article may help. |
Beta Was this translation helpful? Give feedback.
-
Maybe what @bartekwojcik is getting at is the following :
As discussed in @MartinZikmund's StackOverflow post, the documentation provided for creating a new cross platform library using the command line tool DOES show a different way to create one of these libraries.
This approach DOES create what looks like a specific WASM target framework option. Plus, the " #if _ _ WASM _ _ " is available in intellisense with this approach. However, the cross-platform library created by the command line tool ( e.g. 'MyCrossRuntimeLibrary.Wasm' ) uses the obsolete netstandard2.0 as a target framework ( even though it uses the lateset 4.5.9 Uno.UI libs ). This makaes is look old and feel obsolete & probably not the right thing to be doing.
@jeromelaban - I'm not sure what happens if you replace "netstandard2.0" with "net7" (so you can use the latest C# features? Will that still work ?? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the guidance. Unfortunately, it looks like every Uno Platform project team will need someone with a PHD in "Visual Studio Build File Configuration & Customization". |
Beta Was this translation helpful? Give feedback.
-
I'm studying Uno platform, and I would like to write my platform specific code in separate assemblies without using
#if
statements. I googled this link where they suggest using partial classes. Works fine but then I'd like to swapFrameworkElement
depending on a platform. I followed this tutorial and this one and got this code for WASM head that is located in.Shared
project:To keep this code explicitly just for WASM I moved this file to
.WASM
project and added empty stub in.Shared
project:But the result is that when I'm starting project with WASM head no JavaScript is executed and FlatpickrView is not used.
How do I effectively swap Control or Elements depending on a platform while keeping code in its respective head?
Beta Was this translation helpful? Give feedback.
All reactions