✅ How do I get to the graphical window (where I can drag and drop tools)
I'm studying some graphics now with WPF. I've added a button and label, but after I was running the program, the graphical window disappeared , how do I get it back?
Thank you!
61 Replies
you don't have a solution open
it says so on the right
you should open the solution
Is it open now?
I still don't see the graphics
it's not open, no
close visual studio and double click the sln file
I don't know where is the sln file, but I reopened visual studio
Now I have this:
and now feel free to open one of the xaml files.
But it opens a code window and not the graphical window
it is like this:
It's not drag and drop like it used to be
first of all, you should not use the designer for wpf at all
why?
$rulesofwpf
unless you really know what you're doing in wpf, dragging and dropping will lead to a app that looks wonky, can't be resized, etc
there should be an option to enable the designer from the last window you showed
Yep I pressed right click on MainWindow.xaml and then designer
So should I master wpf first and only then to use the design? in order to avoid bugs?
i think you should use the designer first, find out that it can be annoying, and then slowly switch to only editing the xaml file directly
that's what i did at least
get familiar with the whole thing
Directly you mean by coding right?
and then get better at it you know
well, xaml isn't really "code"
For sure it seems like ten times more comfortable than javaFX
For sure I'm starting to get confused 😂
But ok I'll follow what you said
Thank you very much for the help🙏
once you understand the xaml file, it kinda opens up a world for you
you just add grids, grid rows and columns, and then add your individual controls on the grid, specifying their row and column, and their row/column span
all stuff you'll learn over time
i have the designer completely disabled in vs :p
you dont use the designer at all for WPF other than for visually seeing if things look ok and even so you still should not trust it as it sometimes show things wrong
but you should have an icon in the xaml window that lets u open the designer
you write the XAML by hand
Ok I got you both
the app can update most gui as it's running
using the designer to drag and drop controls means u can render your UI out of screen
its not like winforms
it is like winforms though
in winforms you also need a layout table
which is their grid
oh but you don't write the layout by hand :ah_err_bleh:
you misunderstood me its not like winforms in the same you should use the drag and drop in the designer
i mean you still shouldn't, really... you drag the control on there once, but then still change like 10 properties by hand...
@Yarden you should have this
if u click design it will show it up
winforms is just so inefficient
unless u have it disabled in the settings
yeah they got it
u shouldn't drag and drop at all it adds attributes that are not intended
so no they are not the same
and if u want to split the screen with the designer
it would be these
on the right side
no no i was just saying that you also shouldn't drag in winforms if it were possible
Not if used correctly.
In WPF you don't use the designer, because it's not like WinForms where the designer does work.
The WPF-Designer is a mess, that's why it's not advised to use it, write XAML by hand, it saves many headaches.
Note: It's an advice, use at own risk.
since when you do drag, it's mostly just into a layout table, after which you still manually change things like row/column span, anchor, etc
Honestly I don't see this
@er🎃 @SpReeD @leowest
WinForms is another disgning technology of C#?
It's totally newbie with this language
WinForms, WPF, etc are GUI-Frameworks - they have nothing to do with the language C#
i mean "nothing" might be a bit much...
yes winform is a more noob friendly alternative if all u want to do is a mock something up with no cool look or anything just functional
its windows only thou
(so is wpf)
nope
it's literally the windows presentation foundation
wpf learning curve for XAML is a barrier in comparison to getting started with winform
on the other hand it have many good points winform does not
which makes it a much better option for the long run, both in terms of modifying the look of the app and also in terms of modularity and scalability
maui is the first party cross platform gui framework
avalonia additionally works on linux
but wpf is, like the name suggests, windows only
@Yarden this is the run down very dumbed down for people that have no idea which c# ui framework to pick it doesnt include a few things but gives u a general idea https://raw.githubusercontent.com/Insire/diagrams/refs/heads/main/drawio-assets/.net-gui-overview.png
this is out of date, avalonia can do mobile
its not out of date its left out on purpose but you're free to share your opinion on #gui to insire
ok it even says "platforms: andriod ios" so
don't really get it
anyway I dont want to turn this a discussion since its a help thread for Yarden so I rather keep it on topic for him
reason why I pointed u to where to talk about the above image
right
anyway Yarden, about that image
you can find those on those corners
if you closed it and only see the code or the designer it will look like this at the bottom
if u dont have it at all u might need to look into the settings to see if u disabled it
Tools > Options > XAML Designer (at the very bottom)
Yep I found in the end
Thank you all for helping me, your conversation helped me to understand few things, so it was blessed anyway.
Thank you much!
you're welcome 🙂
$close
If you have no further questions, please use /close to mark the forum thread as answered