madskristensen / AddAnyFile

A Visual Studio extension
Apache License 2.0
262 stars 119 forks source link

Added a XAML template #78

Closed ScottSEA closed 12 months ago

ScottSEA commented 3 years ago

XAML template for Xamarin Forms developers - admittedly biased despite WPF or UWP using XAML as well.

madskristensen commented 3 years ago

Thanks for the PR!! I'm not sure how this will be received since it's Xamarin only. It's probably not the main use case for .XAML files in VS. There might not be one at all. For instance, for WPF how would we even know if the user wants a Window or UserControl ?

ScottSEA commented 3 years ago

The more I think about it, the more I think it should just be an empty XML file with a <?xml version="1.0" encoding="UTF-8"?> declaration and the xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" namespace. Maybe put the cursor $ as the empty first element?

chucker commented 3 years ago

@madskristensen can VS's file templates be accessed from the extension? Would it be possible to cache those per-file extension, maybe, and then build a simplified version of the picker:

So, for example, once you're down typing Controllers/InvoiceController.cs, you can use up/down to pick between class, interface, struct.

*) perhaps with the addition of a label that shows which template would be used.

insomniachi commented 2 years ago

Is it possible to add different xaml flavours based on the project you're adding the file to ? ie, use a different template based on project type ?