(Xaml Markup Elements) switch issue level for xaml related methods to warning for first build and add a c# markup specific ContentDialog template #18674
Labels
difficulty/tbd
Categorizes an issue for which the difficulty level needs to be defined.
kind/enhancement
New feature or request
triage/needs-information
Indicates an issue needs more information in order to work on it.
triage/untriaged
Indicates an issue requires triaging or verification
What would you like to be added
See Edit Note in reasoning, there seem to be a fix for wpf solutions you might could replicate for fixing? Else: Add a "first time" marker to xaml using elements in project file or other codebehind for the compiler, that disables errors/issues coming from unrecognized e.g. InitializeComponent() Methods caused xaml at/after build/compilation or alternativly set them for before first build to just warning if possible
Add a c#-Markup using ContentDialog Template to the chooseable Templatelist which visual studio uses on Add>New Item
If it is possible to influence the generator of the csproj file, please add the capability to it to first look up the named itemgroups & items in it and maybe make it more sorted?
If the named path/file is not longer existing, it should not add duplicates of them, else if it is not exsisting (mostly relevant in pre release state), just let it delete the item group thats not longer needed.
Why is this needed
[Added Edit Note:] Researching for existing workarounds of other Developers in internet for the curious case of the duplicate Pages Warning, I found this report which is quite matching to the behaviour (including screenshots and comments of many users) I expirienced with point 1 of my list. https://developercommunity.visualstudio.com/t/Second-time-reporting:-WPF:-C-Editor-ca/10532548
In the middle of the quite neverending story there it seems to be fixed, but if you scroll to the end (August 2024!), where the problem in WPF Applications seems to be fixed, they are explicit mentioning UNO and MAUI applications:
In case you created a application with c# Markup and decide to need a ContentDialog, you would normally do this in visual studio:
Folder/Solution>RightClick>Add>New Item
this will prompt you the template manager to choose a template from the list and set its name.
Because all uno templates are listed as c# Elements the estimation would be, to get a cs file like e.g. MainPage with its MainModel like the rest of the solution structure.
But what it will give you is a ContentDialog.xaml and under this a ContentDialog.xaml.cs so someone who was happy to just have to learn c# to develop a uno application, will have to learn xaml additional and be promted the mentioned issue from 1.
Behaviour of duplication good described here (for WPF)
https://developercommunity.visualstudio.com/t/duplicated-xaml-file/119138
But additionally it is telling me on my device, that the ContentDialog file is already existing. I think that is caused by the naming:
ContentDialog1.xaml
ContentDialog1.xaml.cs
seems like it is thinking the one with .cs ending is duplicate of the xaml only...
For which platform
WebAssembly, Android, iOS, Mac Catalyst, Skia (WPF), Skia (Linux X11), Skia (macOS), Skia (Linux Framebuffer), Skia (GTK), Windows (WinAppSDK)
Anything else we need to know?
Additional (I do not know were this would belong correctly):
Could you add a kind of automatism for the time inbetween, while we have to add xaml files to a c# markup application, that disables the possibility to add a ContentDialog templated file into the Presentation folder?
I already had a few times the issue, that the dublicated page warning throws me a issue because of this, so please take a look into that, so editing the csproj file to clean up not longer existing paths/files manually would not longer needed.
Workarounds?
copy from the mentioned forum above of one of the posts, giving a quite goot summ up of possible (not tryed out) workaround:
The text was updated successfully, but these errors were encountered: