Just provide one API
Why is this so hard for Microsoft?
Provide one API--i.e., one set of functions that can be used to program everything. Have a way for software to query what kind of device it's running on and then it can change its own UI and functionality accordingly. Make the API accessible via unmanaged calling conventions so people can use whatever programming language and development environment they want.
This is really dead simple and it's how cross-platform has worked in the non-Microsoft world for decades. It feels like Microsoft is almost deliberately trying to make development as inconvenient and complicated as possible.