GridSplitter with button for pinning like behavior - wpf

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.

Related

Which layout to use for desining UI in wpf components?

I'am learning wpf. As a part of learning I'm converting a winforms application into a wpf application using mvvm.
In winforms I just dragged and droped. After that I aligned based on my requirement.
But in WPF when i drag and drop a default grid is wrapping the components and I'm facing great difficulty in aligning the components.
On learning the tutorials on wpf https://www.tutorialspoint.com/wpf/wpf_layouts.htm
I tried to work with but I don't know which is suitable for my UI.
I want to create UI in wpf as below winform
I have used grid and stackpanel but I have issue with alignment. In grid I have issue with adding new elements in the existing row. In stackpanel I face issue with spacing between the components and aligning the compnent.
Can anyone help me on which panel to use for the above kind of UI.
In general you don't use editors for WPF, you edit the layout XAML by hand and use the visualizer as a guide to show whether or not you've done it right. The Visual Studio editor does let you do things like basic layout, but as soon as you start using ControlTemplates/DataTemplates/Behaviours etc you'll quickly find that it's useless (and believe me, that moment will come much sooner than you think). If you really want to use a graphical editor then Microsoft Blend is your best bet, but even that is generally designed for non-programmers. In fact, in the 10+ years I've been a professional WPF contractor I've yet to encounter a single company that actually uses Blend...or indeed any other GUI-driven XAML editor...for their product development.

Telerik, Infragistics, XCeed,

I'm looking for a vendor for a grid control for WPF that works nicely together with MVVM; and that allows grouping by dragging the columns. I've been looking around and at first sight it seems that my choice at the moment would be Telerik.
If there are people that have experience with one or more vendors, I would like to hear your opinion.
Thanks!
L
did you try the dataGrid included in WPF .net 4.0?
as MS finally added one, you could first try to use it and see if it suits your needs.
except of course if you are limited (having to use .net prior to v4.0 for instance...)
see there for more info:
http://msdn.microsoft.com/en-en/library/system.windows.controls.datagrid%28VS.95%29.aspx
The Xceed DataGrid for WPF does support MVVM. You can refer to their product page for more information here and you can also refer to their extensive and online documentation here.
After installation, you are also given many sample applications that are installed on your machine. You can find them here:
C:\Xceed Samples\Xceed DataGrid for WPF Professional Edition vX.X

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

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.

What commercial WPF suite is better? Please suggest

Im working on a middle size project, using WPF. Need DataGrid, suitable for the client: fast, customizable, beautiful. Which component suite do you suggest from your practice?(for example Devexpress's, telerik's, Infragistics's and etc)
I have used Telerik data grid in the past and it seemed to have the least hastles for me compared to others I have had a look at.
However I can pretty much put my money on it that someone else would feel that Telerik's control wasn't great and that Infragistics was better etc. - so I suggest that you maybe download the trials and test them for your specific scenario.
"Fast, customizable, beautiful." - try Xceed's (I work there), there's a no-install XBAP demo. Also supports asynchronous data virtualization and smooth scrolling and other stuff no other datagrid does.
Xceed DataGrid for WPF main page
XBAP demos page
I've been evaluating Xceed for a few weeks now and while it is powerful it's dog slow when placed in a tab control switching between tabs. 30 seconds to open a tab on a large data set. The forum on their website seems to suggest this is a known problem without resolution. Shame as in other aspects it appears to do a good job.

Is there a good iTunes coverflow-type control for WPF?

I am currently using Telerik's carousel control, but it is lacking many features and is buggy. Is there a good control out there that looks the the coverflow control in itunes?
WPF Cover Flow Tutorial
Source Code: Part 7, Download
Author's rebuttal to claim of memory leak (it doesn't): Part 8
In Action: Videos
Contains a detailed walkthrough for building a coverflow control, including features such as reflection. I compiled and tried it out and pointed it to a directory containing hundreds of smallish images (you'll need to edit TestWindow.xaml.cs to point to a directory containing jpg's) and I was impressed with the performance and smoothness of the animation.
I noticed that using very large images degrades the performance though, so I'd recommend using images that are just the size needed for display. For example, when pointed to my desktop background images directory, there was nearly a one-second delay after pressing the arrow key and the item going through the transition (although the animation itself was still fluid, it took a moment to begin).
This is the best one that I found, for what I was looking for - namely, non-commercial, reflections, and smooth animation. I did look at the other ones currently mentioned in the other answers though, here are some comments on them (in no particular order):
FluidKit's ElementFlow
Open source, I used the latest source code, but did not try out any patches
Animation was smooth
Transition didn't feel very refined, the pictures clip each other in an odd way
Didn't seem geared for showing a handful of element's on the screen at once, it tries to show everything, and from some of the discussion comments, apparently isn't virtualized
After adding some images to the demo through the provided button, a large portion of them couldn't seem to get selected
Doesn't have reflections
Mindscape CoverFlow
Commercial
Animation was smooth
Doesn't "popup" selected item, feels very 2D
Has reflections
DevExpress Carousel
Commercial
No online demo and I didn't try to obtain the trial, looks polished though
Telerik Carousel
Commercial
Animation was smooth
The transition wasn't as pleasing to me, the new picture passed through the old one
Doesn't have reflections
Xceed Cardflow 3D
Commercial (professional edition only)
Animation was smooth, if you went quickly it would show blank cards speeding by and then fade in the actual data on the cards when you slowed down
Supports flipping the selected item, like in iTunes
Has reflections
ElementFlow control is inside the codeplex project called FluidKit - can be downloaded from here
For more details about the control - ElementFlow control at Pavan's blog
Mindscape now provide a commercial WPF Coverflow control as part of their WPF Elements control pack that might be useful also.
http://www.telerik.com/products/wpf/carousel.aspx
http://www.devexpress.com/Products/NET/Controls/WPF/Carousel/dependency_properties.xml
Both of these are FAR more versatile than your average cover flow clone (though they can easily just do that too if you want). I'd recommend Telerik well above DevExpress as WPF is still a relatively immature technology and DevExpress are very poor at keeping up with the tech game (they only JUST released a VS2010-supporting version of their DXperience suite despite promising it "just around the corner" since the start of January, while Telerik, ComponentOne etc all keep up with current tech. Not good enough for enterprise).

Resources