Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Designer? #4

Open
lucid2310 opened this issue Mar 18, 2023 · 1 comment
Open

Question: Designer? #4

lucid2310 opened this issue Mar 18, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@lucid2310
Copy link

I wasnt sure how to contact you directly, I am trying to design the layout of my UI using the xaml designer in visual studio 2022, but visual studio is having some issues and puts a message "SomePage.xaml cannot be edited in the Design View." I was wondering if there were any tips to get this working? Or if you have any suggestions on a good designer, I am all ears! Thanks! I see on your profile you are in Florida, nice I am in Palm Bay / Melbourne area myself.

@Videogamers0
Copy link
Owner

Videogamers0 commented Mar 18, 2023

Sorry, Visual Studio's designer doesn't work with MGUI and I'm not sure if it'd even be possible to get it working since would involve an entire MonoGame process inside it. The Visual Studio XAML editor is still useful for various intellisense like autocomplete or syntax highlighting.

If you're working on a simple UI, then in my opinion the best approach is to use the MGXAMLDesigner control. If you run the Samples project, the Compendium window has a 'XAML Designer' window under the Dialogs section. Open that window at runtime, and browse for a file with the 'From File' tab. I usually edit my XAML in Visual Studio's XAML Editor (to utilize the autocomplete/syntax highlighting etc), then click the Refresh button on the MGXAMLDesigner control to see how it looks. The MGXAMLDesigner doesn't support DataContexts yet but would probably be a simple feature to add, or you could just hardcode a DataContext in MGUI.Core.UI.MGXAMLDesigner.RefreshParsedContent() while working on a dialog.

Of course, even with the above approach you'll still only be able to see how the result looks. There's no properties window or anything that lets you manually place controls with the mouse cursor etc. I probably could add some kind of properties window to the MGXAMLDesigner control though.

@Videogamers0 Videogamers0 added documentation Improvements or additions to documentation question Further information is requested labels Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants