WPF: Do VS 2010 and Blend 4 really integrate well? - wpf

I'm new to WPF, so this is my first project.
I started with the coding side of things using VS. I am overall pretty satisfied with the way VS is used to build a WPF app, however a big part of WPF is also animation.
So to my relief, I was able to open the solution I created using VS 2010, in Expression Blend 4.
I opened it, but then I noticed the form design view in Blend 4. My heart sank. Please don't tell me WPF 4 is still so immature as a product that you cannot yet work decently with WPF projects created in VS 2010?
See the screen shots:
Here is good old VS 2010 form design view. As you can see there is a menu and a label control on the form.
Here on the other hand is the same form open in Blend 4:
As you can see, no design time support it seems for ANY existing elements. The form besides being black, seems to not contain my menu or label.
Have I done something wrong, or is Blend this immature?
My course of action seems to be learning the XAML and using pure VS 2010 for animation, but that means that Blend 4 would be a failed product in my eyes.
Update:
Here is the full screen , so this is after opening the MainWindow.xaml in Blend 4.

Ok well I figured it out.
I am guessing its also a bug in Blend 4.
In VS 2010 my Window visibility was initially hidden, this is because I have a custom splash screen which first loads, then sets the visibility to true.
So design mode imo of Blend should not pay attention to the Windows visibility property, this is a run time property really.
Setting the visibility to true of the form / window. and the results are better.

Related

Can i implement extreme design elements in my app with Visual Studio, or do i need Blend?

I'm new to Visual Studio and Blend and i'm trying to see their difference. I thought that Blend was ideal for adding more design and interactivity into your app so i chose to use this in order to create an app about a virtual museum (which i wanted to include design and 3d elements).
So far i have created 2 Grids. The 1st Grid contains a sign in or sign up option(along with its design for which i used Blend tools). The 2nd Grid is the registation form which i wanted the user to be redirected to after the user has clicked the sign up button. I'm trying to make the transition from grid 1 to grid 2 like if i had two windows forms, but i can't seem to find how i can do that. Any ideas on how to do it?
I tried to open it into Visual studio and it doesn't seem to respond that well.I suppose i must do something wrong.
So taken the previous difficulties, i'm wondering whether Blend is not necessary to use to create this kind of app and i could simply use standard Visual Studio's windows form without having problem adding design elements.
Thanks in advance
Visual Studio has all that you need to be able to do your interfaces as you want them to be. As Glen Thomas said, you should learn how to code in xaml to create your interface. Visual studio gives you a render of what it looks like in real-time while coding it so it might be helpful to do it this way.

When to use Blend for a WPF developer?

I'm a WPF developer and use VS Pro 2012 everyday for UI adjusting and coding. I installed Blend for Visual Studio but I never used it (just launched it by accident several times).
I'm afraid that I missed something by not using Blend. If I did miss something, what is it then?
Blend lets you design WPF UI, create controls and determine their behaviors visually (by UI), and Visual studio lets you do that programatically.
There is nothing you can do in blend, that you can't do in visual studio.
It is a tool for people who are less comfortable using code, and more comfortable using a cool UI to create custom controls and behaviors and design thier UI
In Visual Studio 2012 and later, the WPF UI designer is Blend; it's actually loaded in the background and accessed through out-of-process COM interfaces. This is part of the reason its behavior can be a bit bizarre at times, why you get messages about being able to edit the XAML while the design surface is loading.
If you're used to VS form builders you're going to be fine with Visual Studio.

WPF Designer vs Qt Designer and Widget Parenting

I'm an experienced C++/Qt developer but a newbie C#/WPF developer, and I'm wondering if I'm missing something with the Visual Studio 2010 WPF designer.
In Qt, all widgets have a parent. I found this concept very useful both when building GUI programmatically and in the designer. From what I remember from Qt desginer (unfortunately my new company doesn't support Qt), you could easily drag widgets around and they get re-parented correctly. If the designer somehow got confused, then you could just reset the parent to whatever you needed in the properties box. I find the analogous ideas in WPF difficult to execute.
In the Visual Studio Designer, when I drag widgets around, they only sometimes get the right parent. More often than not, I have to go to the xaml and cut-and-paste the widget I was writing into a different part of the xaml so that it gets the right parent. I understand that the DOM tree of xaml nicely parallels the widget parent tree, but I found that was much more explicit in Qt.
So, my question is: is this cut-and-paste approach to re-parenting in WPF xaml the best you can do or are there some nice designer tips-and-tricks that I am missing?
Note: this question obviously doesn't apply when building GUI programmatically.
In my experience this boils down to a lacking designer in VS2010. Personally I use the designer for WPF as a view on how the GUI will look, and then hand code most of my XAML. I almost never actually DO anything in the designer such as drag an element or such.
To answer your question, the cut-paste in xaml approach you mention is in my experience the most efficient way to "re-parenting" elements.

GridSplitter with button for pinning like behavior

I'm looking to extend the GridSplitter in some way to add a button which when click expands or collapses the control to one of the specified sides of the splitter.
I've found a solution that works for Silverlight 4 but I need this to work for standard WPF in .NET 3.5 which means that the GridSplitter doesn't implement the Visual State Manager stuff that is used in Shemesh's solution. Other than it won't work for WPF in .NET 3.5 I think Shemesh's solutions is probably exactly what I'm looking for with smooth animated transitions and remembering the last expanded size upon expanding from a collapsed state.
Anybody have any examples of this being done in regular WPF?
Ok, I've tinkered with the Silverlight example enough to get something working for .NET 3.5 SP1 and the WPF Toolkit February release for the Visual State Manager stuff. Below you can find the two main source files that I've fixed, refactored, and reorganized quite a bit.
The solution is to big to post on StackOverflow so please see my blog post that has the code snippets you will need.

Blend 3 - Keyboard Shortcut to switch between design and xaml views?

As I'm not more of a developer than a designer I like to hand code my xaml rather than using draggy-droppy stuff.
Since silverlight 3 - the design preview in VS2008 has disappeared. It wasn't that great but at least I got a visual representation of my markup without having to run the application.
So I installed Blend 3 and I'd still like to hand code my xaml.
Does anyone know a keyboard shortcut to switch between design view and xaml view - I've tried editing the xaml in VS then tabbing over to blend but theres a small delay that can be annoying when I just want a quick preview.
Thanks.
For doing the thing you want please test the following solution:
Navigate to Tools menu of the visual studio
Click the Options menu item
From left pane choose the Environment and then Keyboard
From right pane choose the Visual C# 2005 combobox item
Now you can easily switch between xaml and the desing view by pressing Shift + F7
Are you talking about while in Blend? In which case it's F11 to toggle view.
If your talking about toggling between VS and Blend then I don't think it can be done, but you could try adding a Keyboard Shortcut in Tools->Options->Keyboard (not tried it and don't know if it would be successful).
In Blend you can use F11 to toggle between the three states:
Design View
Xaml View
Split View
It seems to me that what would help you the most is to change your default view:
-> Tools
-> Options
-> Documents
-> Change the Default Document View to either Xaml or Split View
And there is a way to toggle between VS and Blend: I do this all the time with Alt + Tab. I'd be cautious though: you should save the solution before switching to keep the two apps in synch.

Resources