What is the thing at the top of WPF Windows in Visual Studio 2015 - wpf

Is it useful, and how can I toggle it on/off? I would just google it, unfortunately "thing at top of screen in WPF" doesn't really turn up anything useful.

It is a new WPF debugger tool found in Visual Studio 2015 Update 2. It shows the live visual tree which can be very helpful for debugging WPF applications.
You can find the feature in this changelog: https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
Edit: To disable this, click the left-most button in the dropdown, and then click the left-most button on the resulting live visual tree panel.

Related

Visual Studio doesn't show the Visual Designer for a Popup anymore

So in the past when I clicked on the XAML on a Popup, Visual Studio would show me the Visual layout of the Popup's contents. And I could move elements around just like a normal Window.
I can no longer get this to happen. It was about 5 years since I tried and last time I was using Framework and a different version of Visual Studio.
I'm on Visual Studio 2022, using .NET 6.
Is this no longer supported or am I missing something? In the past if I recall correctly your popup had to have a Height and Width for it to appear in the visual designer, but after trying it, that doesn't work.
I've tried Blend as well with no luck. No options on the Right-Click menu.
I can edit by hand but that takes so much longer than using a visual editor for positioning.
Any ideas?

Simple ControlTemplate (edit a copy) for WPF Window doesn't work in Blend for Visual Studio 2017

Goal: Edit the ControlTemplate of a Window to remove the caption buttons via Blend (Close/Minimize/Maximize). Why? Need a window with a title bar (draggable) that can't be closed/minimized/resized. It's a temporary status window that pops up, etc. (I've seen solutions that go into the Win32 APIs, and wonder why. This should be doable via Blend!)
Anyway... Blend for Visual Studio 2017 seems to be OK with my attempt. At least initially.
Click "[Window]" in the Document outline and then select "Edit Template => Edit a copy"
Blend complies and gives me this control template.
However, immediately the XAML is flagged as having errors.
I figured "well, maybe this is just a designer issue. Maybe it will build." Nope.
"The type reference cannot find a public type named 'WindowInstance'.
"The name 'WindowInstance' does not exist in the namespace
'clr-namespace:Microsoft.VisualStudio.DesignTools.WpfDesigner.InstanceBuilders;assembly=Microsoft.VisualStudio.DesignTools.WpfDesigner"
Well, I've looked for "Microsoft.VisualStudio.DesignTools.WpfDesigner" on both NuGet and in the install folders and it doesn't seem to be there.
I've also read this solution, which mentions adding "Blend for Visual Studio SDK for .NET" in the Visual Studio 2017 installer under the "Individual Components" page. I've done that. Still I have the error.
I'm uncertain where Blend got the initial ControlTemplate from in the first place if it doesn't resolve to an assembly on my machine.
Regarding the actual solution... what I'm doing now is faking a window with a title bar (that has no buttons) and using the system brushes to make it look like a window with a title bar--but that isn't draggable... which is another problem to solve.
Really, why I can't do something as trivial as removing control buttons from a window is beyond me. I suppose there are philosophical reasons to not allow people to remove the close button on a window, but that shouldn't be some arbitrary call that a dev at Microsoft gets to make for me or anyone on my team.
Thank you for your assistance.
Chad.

Object reference exception when drag and dropping from toolbox to Windows Forms designer

When dragging a control from the toolbox and dropping it in the Windows Forms designer, a message box appears with the message Object reference not set to an instance of an object.
After closing the message box, I can drop the control on the form without any other issue.
This happens on a new project as well. The error appears in both VS 2015 and 2017 (both community editions).
EDIT : This happens on any control, including custom ones. This started happening after I updated to the latest version of Windows 10 (17134.48).
Instead of dragging and dropping, Clicking on the control, then clicking on the form is the workaround working for me until they come out with a newer update.
This is new behavior as of Visual Studio 2017 Version 15.8.6 for me.
Hopefully this will help others that just kept dragging and dropping over and over like I was doing :-)
Experiencing the same issue on Microsoft Visual Studio Community 2019 Version 16.5.0. I found that I was not able to drag and drop controls while VS was open on my high DPI external monitor, but if I moved VS to my native laptop monitor, I was able to drag and drop the controls.
For Visual Studio 2017 I did not fix the problem, but I found a workaround:
went to C:\Users\user.name\AppData\Local\Microsoft\VisualStudio\15.0_e3603226
deleted all *.tbd, privateregistry.bin*, ApplicationPrivateSettings.xml files
deleted all files in ComponentModelCache folder
restarted Visual Studio as Administrator
it showed a message of updating the MEF files
drag and drop is NOT working. It keeps throwing the same error
BUT I can click on the item I want in the toolbox and then click on the designer without dragging and it works.
For Visual Studio 2015 I did not fix the problem, but I found a workaround:
went to C:\Users\user.name\AppData\Local\Microsoft\VisualStudio\14.0
deleted all *.tbd, *.lock, devenv.exe.config files
deleted all files in ComponentModelCache folder
restarted Visual Studio as Administrator
drag and drop is NOT working. It keeps throwing the same error
BUT I can click on the item I want in the toolbox and then click on the designer without dragging and it works.
I have also seen the same problem repeated today in Visual Studio 2019 (Today is June 27 2019). I am trying out the VS 2017 solution from CristisS (above). I have verified that the 'workaround' still throws the exception, however, you can immediately draw the tool onto the form.
I repeatedly run into the same issue. Seems to always be caused by running the Windows Forms designer on my secondary monitor. I don't know what causes it to misbehave, but moving Windows Forms Designer window back to my laptop screen always fixes the issue. Idk if it has something to do with scaling, or what, but it is a very repeatable issue that needs to be addressed.
Moving Visual Studio over from my hi res secondary monitor to my primary laptop monitor did fix the issue.
To use Visual Studio on my larger secondary monitor, I set my secondary monitor from 3840x2160 down to 2560x1440 and set scaling from 150% down to 100%
This lets me Drag and drop from the toolbox to the designer in Visual Studio 2019 (V16.11.3) without issue again.
I found two solutions, to this problem that they worked for my WPF project in VS2015
solution 1) Click on the icon "enable/disable project code" in the bottom of windows design(the last icon near the percentual of zoom)-->Put Disable.
solution 2) Dx mouse button on your file .xaml and apply your modify in blend , selecting the "Open in Blend..." menu.
That's all
Daniel.

Unable to add WPF controls to the toolbox in Visual Studio 2013

First of all, I am completely new to Visual Studio, so please don't be too judgmental. I have a project I need to do in C# for my studies and my team uses a GitHub repository. I am in charge of creating the GUI and I am stuck at the very beggining.
I want to create the main application window using WPF, but when I use toolbox > choose items, I can not see the WPF tab. Also, when I am trying to enable the designer view, nothing happens.
Is it perhaps the software version being Visual Studio Community 2013 causing the issue? Do I need to have the Visual Studio Professional version in order to use WPF toolbox?
I'm attaching a link to the screen of the situation below.
As I presumed, all I needed was the professional version of Visual Studio. After obtaining and installing it everything works fine.

How to have insert/remove WPF grid row/column in context menu in design mode?

In the machine at the office my Visual Studio 2010 has the context menu to insert/remove row/colunm from a grid which is very convenient compared to manually insert - requires to update every each of the current row/column indexes.
But at home, my IDE doesn't have this menu. I don't know how to have this context menu Grid Row and Grid Column.
Update
My VS version at home
My VS version at office
go to silverlight.net, click the getting started link, and download the latest version of Silverlight Tools for Visual Studio 2010. This is for the WPF designer too.
I'm guessing you might not have the same version of Visual Studio?
Can you compare them? Not just if it's both 2010. In any case: My Premium version at work definately also has it.

Resources