Custom Wpf ListBox Control - wpf

I'm new to wpf and have just been given a project to create a set of custom controls which will be used to make a previous windows forms application more manageable and current. However I cannot seem to find much info with regards to customising the built in Listbox, this would involve preferably replacing the scroll bar and the +/- buttons with custom images etc..
Just wondered if anyone knows how to get at these ?
Thanks in advance.

Check here for the default control template of the listbox.You can customize the scrollviewer there to do what you are looking for.Check the below article to get started
Using Templates to Customize WPF Controls

Learn about WPF styling and templating. Other than that, the question is too generic for SO. Read the article (and perhaps google some more articles on the topic), try to style the listbox and come back with specific issues. WPF is not easy to get into, but it is definitely worth the time.

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.

Creating a walk through in WPF

I'm trying to add a "walk-through" mode to my existing WPF project which will guide the user through the process of using my application. Trying to look this up is difficult, because every Google search for "WPF walk through" returns a walk-through on how to use WPF!
I've thought of something like using tooltips and programmatically controlling when they are visible for each control in the GUI ("Press this button next, etc") but I'm hoping for suggestions on a better way as I'm still pretty new to WPF.
Thanks,
Mike
I would use Popup.
Just show same popup with different content near to interested controls
What you appear to be looking for is a wizard... check this one out:
Extended WPF Toolkit™ Community Edition

SilverLight like Datagrid Paging in WPF?

Currently I am searching for the best way for paginating the records in WPF datagrid.
I have found one best article which provide best way for paginating records in Silverlight over here.
See it provides also a fabulous demo.
Here is one screen shot.
But when I have trying it to implement it in WPF I could not implement it?
I could not found PagedCollectionView class and also could not found the alternative XAML code of the Silverlight code shows is below screen shot.
Could any one provide or suggest the best way for paginating the records in WPF
as like Silverlight?
You can grab the PagedCollectionView source code from here and compile it into your WPF project. I've done this for a WPF project in the past and it works just fine. However, you won't have the supporting types like DataPager, but it's easy enough just to write your own or throw some buttons on your view that page through the collection.
WPF DataGrid doesn't come with pagination by default. You have to have your own custom implementation. Here is a sample. The sample implements First/Previous as ViewModel commands, however I would advise you to move these commands as part of the control and make a custom DataGrid control that you can reuse across application.

Can I use the WP7 Panorama control outside of WP7?

I need a WPF control that acts like the Panorama control for Windows Phone 7, but I need it for a desktop application.
It will contain a series of panels (or Panorama Items) that the application will be able to slide through horizontally programmatically.
Also, the content inside the panels not currently displayed on the screen will need to be "lazy loaded". In other words, they should be referenced but not loaded or rendered.
Can I somehow adapt the WP7 Panorama control to do this? Or will I have to develop a custom control from scratch to behave similarly to it?
Thank you!
EDIT:
I could probably use a VirtualizingPanel to implement the lazyload behaviour.
MahApps.Metro while still not super mature does allow for the wp7 Panorama control. Demo of how to use a panorama here. I've played with it a little and while its not the most customizable thing out there it gets the job done. Pretty sweet. Also Sacha Barber (Codeproject Demigod) wrote up an article on making your own. Of which I haven't looked at yet but, the guy usually does awesome work. So I'd check that one out as well.
http://blogs.microsoft.co.il/blogs/arielbh/archive/2010/10/21/porting-windows-phone-7-s-panorama-control-to-silverlight-4.aspx gives some clues about how do to this.
It suggests using http://phone.codeplex.com/ as your base and then you can use http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=4b281bde-9b01-4890-b3d4-b3b45ca2c2e4 (Microsoft Surface Manipulations and Inertia Sample for Microsoft Silverlight) to run convert get it to respond to touch.
Seems none exist as far as I can see so far.
This blog has started an attempt at making it, so you could work from there to make your own. Be sure to also check out this page which details the creation of an individual panorama item too.

Wpf template gallery

Does anybody know of a gallery of controltemplates, that I could use to learn more about what is possible with the different control types?
look at : https://github.com/jogibear9988/wpftoolkit
I've forked the Theming Package from Codeplex and switched to .Net 4.0
I'm not familiar with a gallery of control templates, though there are lots of examples on the internet. If you have a specific control you'd like to template (e.g. a ListBox or a Button), I would search for specific control templates that relate to that control. You will find countless options.
If you want to learn about what is possible with control templates, I'd suggest picking up one of the many great WPF books. A few I'd recommend are:
WPF Unleashed (by Adam Nathan)
Applications = Code + Markup by (Charles Petzold)
WPF Control Development Unleashed (by Pavan Podila and Kevin Hoffman)
You can completely recreate the visual tree of an element with a control template, so the possibilities are limitless. You can also check out the MSDN Help Topics on control styles and templates:
Control Styles and Templates
Using Templates to Customize WPF Controls
Hope that helps.
There's this one
http://www.xamltemplates.net/
There's this one
http://www.reuxables.com/
There's this one
http://www.codeplex.com/Silverlight/Wiki/View.aspx?title=Silverlight%20Toolkit%20Overview%20Part%203&referringTitle=Home
As a word of warning, all templates are not created equal - and not all templates will work across all XAML frameworks. For example if it is written for SL it may not work for WinRT. The same for WPF. But this list will get you started. In the end, you will probably create your own.

Resources