WPF design-time context menu - wpf

I am trying to create a custom wpf control, I'm wondering how I can add some design-time features. I've googled and can't seem to get to my goal.
So here's my simple question, how can I add an entry to the design-time context menu for my WPF usercontrol? The context menu by default has entries View Code,View XAML, etc.

You probably want to check out the WPF Designer Extensibility documentation. Specifically it sounds like you want to create a custom MenuAction.

This will help you get the context menu you require, although this applies to datagrid's still applicable;
WPF DataGrid Design-time Walkthrough

Related

"Make into Control" option in Microsoft Blend 2015

I have tried to use this Tool and I don't understand its purpose. In previous versions, it created a UserControl out of the selected controls. Now it creates a ButtonStyle for what I have seen.
How can I use this tool?
The old Blend has two options, Make Into UserControl and Make Into Control.
The Make Into UserControl wraps whatever you selected into a UserControl while the Make Into Control has always been turning whatever you selected into a Custom Control.
A Custom Control generally has a default style, and that's why you see that predefined ButtonStyle1 on the popup. A Button is a Custom Control, and that's why you can customize its look and feel by changing its style.
I'd strongly recommend you to have a read on how to create a Custom Control.

How to have properties of custom control in xaml when we drag that control?

I have created a custom control for TextBox with soem DependencyProperties and some simple properties, now, when I drag my custom control from ToolBox to designer then I want to have properties which are declared in custom control to appear in XAML by default.
Does anyone have idea about it?
Looking forward for quick reply.
Samir
We can add the properties to the control by default while you are dragging from ToolBox to the designer..
Please refer the below msdn documentation..
http://msdn.microsoft.com/en-us/library/bb907306(v=vs.90).aspx
i think it will help you to resolve the problem..

Where can i find Free WPF controls

Is there any site available where I can find free WPF controls like Griview ? I am currently working on a complex project where I need a customizable WPF Gridview like telerik
You can use controls from the WPF Toolkit as well as Extended WPF Toolkit.
Have a look at the controls in AvalonControlsLibrary on code plex, it is having a DataGridView control apart from other controls. -
http://avaloncontrolslib.codeplex.com/wikipage?title=Home&ProjectName=avaloncontrolslib
DataGridView
DataGridView is a maybe a misleading name for this control. This control is far from being the same as the WinForms DataGridView (maybe someday it will J). Basically this control is a WPF ListView control but it is capable of auto generate the GridViewColumns for you. It generates the columns by looking at the objects’ properties. You can also specify how you generate the columns by decorating your properties with a custom attribute. For more information have a look at this post. http://marlongrech.wordpress.com/2007/09/01/listview-with-auto-generation-of-column-enable-disable-columns/
Similar SF question - Where can I find free WPF controls and control templates?
On codeplex.com and codeproject.com. However the best always cost money.

Custom Wpf ListBox Control

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.

Trick for seeing databound list controls in the VS XAML Editor

Is there any way to see what a control will look like in the XAML designer when it's ItemSource property is databound? I want to see what it looks like in the designer somehow without actually running the application.
Here's a good article by Karl Shifflett that explains how to display design-time data :
http://karlshifflett.wordpress.com/2008/10/11/viewing-design-time-data-in-visual-studio-2008-cider-designer-in-wpf-and-silverlight-projects/
WPF 4 will come with native support of design-time data

Resources