WPF visual state manager in Blend 2 sp1 - wpf

Can anyone explain to me how to get the visual state manager to work with a WPF application? It's just been added to the new wpftoolkit. I installed it as told, but even the sample doesn't show the VSM. In silverlight it work, but not in WPF. If installed the latest Blend 2 and updated with the SP1.

rudigrobler, you've got me thinking... There should be a registry key... So I've just opened Blend in Reflector and started searching...
I've found the location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend
And added the key a DWORD with the name EnableVSM and gave it the value 1
Now it works!
Easiest way to enable is to create a new .Reg file and add the following:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend]
"EnableVSM"=dword:00000001
Now run it and you're done.

This might also help: http://blogs.msdn.com/expression/archive/2008/10/30/blend-2-sp1-wpf-toolkit-visual-state-manager-for-wpf.aspx

Read these 2 articles on VSM in WPF:
http://dotnet.org.za/rudi/archive/2008/10/29/silverlight-love-for-wpf.aspx
http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-visual-state-manager-overview.aspx
Their is a registry setting that needs to be "turned on" for VSM in WPF support for blend... Read more here

Related

Devexpress report designer version conflicts

I'm trying to add a DevExpress Report Desginer Wizard to my WPF project but I keep getting an error about versions. I've posted a screenshot to simplify things
This project already contains references to DevExpress controls of a different version.
The current version is 15.2.4.
Incorrect reference: DevExpress.Data.v14.1 14.1.8
I've updated the project files per the DevExpress Upgrade notes but this hasn't changed anything.
You can try to execute "upgrade tool" from the visual studio menu
DevExpress -> Upgrade tool,
run this tool on the current solution/project, close the wpf window designer, rebuild solution/project, open your wpf window again in the designer, check that the toolbox contains WPF ReportDesigner v15.2 control and add it to the wpf window.
I resolved the error by removing all references to DevExpress components with a different version than the 15.2 that it was trying to use.
I had to clean and build my solution after doing this because they obstinately kept coming back and causing trouble so if you're here looking for a solution, be aware of that.

Why is a project created in VS2012 not editable in Blend4 + SketchFlow

I created a project/solution in VS 2012. I open the same solution in Blend but it doesn't allow me to edit it in the designer - I only can edit the XAML directly.
I'm lost. What's going on?
EDIT: I read somewhere that Blend requires "Any CPU" - I verified that this is set.
EDIT2: It works with .NET4.0. Does this mean that .NET4.5 is not supported?
Yes. It needs the blend for vs2012 preview in order to edit it, however .xaml and .xaml.cs files don't really have any difference between .net4 and .net45, so there isn't anything to stop you creating a solution in vs2010 and including the same files, so that you can use blend to edit it.

Visual Studio 2010 WPF Designer issues

I am using:
Visual Studio 2010 Professional,
Silverlight 4 Toolkit
The WPF Designer don't show (invisible) - while the Component Toolbox is showing the relevant controls, and the Windows->Windows option shows the designer to be active. It does this with ALL XAML for me, regardless of its complexity. I have already tried the /ResetSkipPkgs to no avail. I had CodeRush and DevExpress installed (demo) version but removed both since. I can get along with XAML by switching to Source Code /Text Editor, but this really boils my chops to run the app to find out that I have made a silly mistake in my XAML (while a preview would sort it out quicker, and no, please don't suggest Expression Blend for it is non-nonsensical for me to switch continuously between these applications).
When I however switch the WPF Designer to open with Encoding I get the following error - which I assume is related to the issue for not showing the XAML Editor/Designer in non-encoding:
An Unhandled Exception has occurred
Click to reload the designer
System.NullReferenceException
Object Reference not set to an instance of an object.
at MS.Internal.Providers.VSDesignerContext.VSDesignerContextHolder..ctor(IServiceProvider services, VSDesignerContext context, Object docData)
at MS.Internal.Providers.VSDesignerContext.GetContext(IServiceProvider services, IVsWindowFrame frame, Boolean createIfNotExist)
at MS.Internal.Designer.TabbedEditorPane.MS.Internal.Designer.ITabbedEditorService.get_DesignerContext()
at MS.Internal.Designer.DesignerPane.InitializeDesigner()
I have googled it silly, to no avail. I am thinking about reinstalling Visual Studio - but this REALLY is a last resort. I hate fixing things by reinstalling, rebooting etc.
Any guru with the magical answer?
I got the exact same exception today and solved it by killing a few GDI hungry apps. You can see the number of GDI objects a process is using in the Processes tab of Task manager (you will probably need to add the column using View -> Select Columns).
Hmm, I know this is old, but you should try installing SP1 for your Visual Studio if you haven't yet.

WPF Application template is missing

My VS2010 install has WPF Browser application project template, and WPF User Control lib template, but no WPF Application template. Any suggestions would be appreciated.
For me I was missing ProjectTypeGuids in the .csproj file (a new project worked for me so just compared the project files), so if you add this to the .csproj file under PropertyGroup I then had all the WPF types available for adding:
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
This is kind of an old question, but I just hit the same issue and found the answer after the above didn't help, so....the solution for me was that I had to select a higher framework version (4.0) before the WPF Application template I was looking for became visible. If you find that you don't have the WPF or other project templates you expect available, you may want to check that you've selected the approriate framework version from the drop-down list immediately to the right of the "Recent Templates" label in the Add New Project dialog (it's near the top-left of the dialog in question).
This issue is a lot older than Visual Studio 2010. It goes back to 2005 at least. Lucky you, I was missing the New Class template once.
According to a bunch of sources, this trick works:
If you are missing a template that comes with your installation, run devenv.exe with the /installvstemplates switch.
You'll need to exit out of all Visual Studio instances for this to work.
The trick is mentioned in the MSDN documentation:
http://msdn.microsoft.com/en-us/library/0fyc0azh.aspx
Thread on the issue in a previous version of Visual Studio: http://social.msdn.microsoft.com/forums/en-US/vssetup/thread/8a5ae9e3-be7b-493d-831c-1e49e8103f26/
I wound up uninstalling and reinstalling my Visual Studio entirely but this trick probably would have fixed my problem.
Just had this in VS2017 Community Edition. This discreet message to add missing templates helped me:
In VS 2017
Make sure that you have .Net Desktop Tools checked in you VS
https://developercommunity.visualstudio.com/content/problem/44429/missing-wpf.html
For .NET 5 (or newer) is needed to have in .csproj in xml path Project/PropertyGroup:
<UseWPF>true</UseWPF>

Why isn't Expression Blend rendering my User Control? It's only showing XAML

I'm opening valid XAML within my VS2008 solution in Expression Blend 3 and it is only showing XAML when I try to open individual XAML files. My solution/projects all build and run correctly.
When I go to View -> Active Document View the Design View, Split View and XAML View options are all grayed out... which doesn't make much sense.
I'm not much of a Blend user, but this has never happened before, and I'm coming up blank for how to fix it. Any ideas?
How did you create your project ? Did you use the "Class library" templates in Visual Studio ?
I remember I had a similar problem. You can create a new WPF project and compare the CSPROJ with the one not working in Blend. You should be able to see the differences and add the missing lines in your CSPROJ.
HTH
For me, the problem was solved by changing the target framework of the project - I was using 4.5, but Blend could support max version 4.0 - try that...
open the project file in notepad and add the following line within the <PropertyGroup>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Found the solution here -> link text

Resources