The failure of windows phone had nothing to do with 'developer engagement'. Simply put they were far too late to market to compete with the already established iphone & Android.
They might have had a shot if they had realized it and focused from day one on the business market (which they were already a player in), but instead attempted to compete with Google and Apple who had more cachet with consumers.
Smartphone history doesn't start in 2010. It didn't start in 2007 with the iPhone, either.
Those of us who have longer memories are aware of the iPhone's predecessors. For quite some time, it was a three-horse race between Blackberry, Windows Mobile, and Palm. Blackberry was preferred by many businesses because of BES - it was a bit expensive, but it was super secure and made it possible to replace a lost or damaged Blackberry with a fresh one in about 20 minutes, with all the user's accounts and data intact. Palm was very simple to use, had great battery life, and Palm Desktop was like Outlook Lite and Salesforce Lite rolled into a bundled application.
Believe it or not, Windows Mobile was amongst the most versatile platforms of its day, and it was king of the third party apps. Those apps weren't purchased through the App Store, they were purchased at retail on SD cards or from developers' websites...but there were more for WinMo than anything else. It was kinda ugly on the surface, but in HTC's heyday with the Touch Diamond, Touch Pro2, and HD2, it had more eye candy than the iPhone. WinMo was easy to manage because it was treated like a desktop in Active Directory, and though Windows Media Player for WinMo had its idiosyncrasies, it wasn't until maybe the Blackberry Curve that there was a media playback application for a mobile platform that outperformed it. As an added bonus, XDA-Developers started with WinMo phones. If you think Android is customizable, you should see some of the mods that were done back when WinMo was a thing.
The writing was on the wall for WinMo when it became abundantly clear that stylus-based input was a compromise, not a desirable state of existence. With the exception of the HD2, everyone else had a resistive touchscreen, which has long since been obsoleted. If you've never used IE Mobile, be grateful - it'll make you pine for IE6.
Microsoft attempted to reinvent itself with Windows Phone 7, right around when Android hit the scene. It was definitely more polished at the time than Android was, but they bet on XAML and Silverlight-based applications, which wasn't the best start. They also bet that having a rooting/modding community was a liability rather than an asset, so they put the kibosh on it early and were pretty successful at preventing third party ROMs and mods from making the platform attractive to the technically savvy. Meanwhile, stability was a major problem, Nokia phones took *years* to arrive, and when they did, most carriers had more options in their iPhone lineup than their WinMo lineup. On top of that, Microsoft was still trying to not-suck at the media management department; WMP10-12 wasn't bad for local media syncing, but this was back when iTunes was actually good, and Microsoft still didn't have a good way for users to download music and movies.
Developers had to start from scratch upon the arrival of WP8. WP7 apps weren't compatible with WP8, and WP8 wasn't compatible with the majority of WP7 devices - keeping in mind that this happened when 2-year handset contracts were still very much a thing. Microsoft could have given themselves excellent mindshare by allowing WP7 users to trade their phones in for WP8 phones at no cost, but instead they released 7.8 which had about half the heralded WP8 features...and for all the complaints about Android fragmentation, the complete incompatibility between WP7 and WP8 was far worse. There was all kinds of attempts to do Google-style integration with Bing, which worked as well as you think it did, and Cortana tried to eat Siri's lunch, but especially in its early days it was terrible with doing anything other than transcribing Bing searches. Stability issues still abounded, there's still no third party keyboards for the platform, still no rooting or modding of consequence, and then they promised Windows 10 Phone.
And they broke backwards compatibility AGAIN.
So, once again, all the developers who made the attempt to invest their time into making a WP8 app were now told that, once again, they wouldn't be compatible with W10P. Now, to be fair, I do believe that Microsoft did provide a set of porting tools to facilitate the transition, but once again, there were WP8 phones left behind, so the WP8 apps still needed to be maintained. During this time, Microsoft spun off a bunch of their useful Nokia holdings, Steve Ballmer was ironing out the details of his golden parachute, and I'm certain the board was looking critically at their single digit market share, wondering exactly whether to double down yet again, or to just make it desirable for Microsoft apps to run on iOS and Android, while giving app developers reasons to put the back end on Azure.
So yes, there was plenty to do with developer engagement, they were established in the market long before iOS and Android were ever a thing, they had a focus on the business market that didn't pan out, and they lost cachet with consumers because they were focusing on all the wrong things and didn't have a good enough reason to jump ship from iOS or Android.