Silverlight Bing Maps Pushpin Styling - silverlight

Does anyone know if the default control template and XAML style is available anywhere for the Bing Maps Silverlight controls? We like the general appearance of the default Pushpin control, but want to have them available in multiple colors, not just the default orange. It seems the only easy or straight-forward way to do this would be to provide a new ControlTemplate based off the default -- one for each color -- in our App.xaml.
Not a problem, except that I have been unable to identify the existing default control template. Most of the core Silverlight toolkit controls have their default styles available on MSDN, but I haven't found the ones for the Bing Maps API.
Thanks,
Jeff

Just set the Background property to change color

Related

can my control have multiple themes by default

I have a control and i put its template in generic.xaml.
is it possible to have other themes like:
bluesky.xaml
tealocean.xaml
How would I do this? How would the themes get changed?
The best currently available way is to use Theme control from a silverlight control toolkit to dynamically change themes.
Here is an article on this: http://weblogs.asp.net/lduveau/archive/2010/05/31/dynamically-apply-and-change-theme-with-the-silverlight-toolkit.aspx

How do WPF themes get loaded?

WPF controls get their default styles, colors and brushes from a theme (Usually, in PresentationFramework.Aero.dll).
What piece of loads this assembly? And where are the resource dictionary stored?
I have my own WPF custom themes and load them in the Application.Current.Resources.MergedDictionary.
However, this does not work if the WPF themed control is hosted in Windows Forms since Application.Current is null.
Is there a way to do something similar to what WPF does? If so, what is it?
You cannot use the WPF themes in Winforms because they are two different technologies. There isn't a similar theme mechanism in Winforms natively. You can use third-party controls that support themes in Winforms. The most notable of these are the tools from Infragistics and Telerik.
Bottom line answer is no, there isn't.
Can you try just adding the theme to the control instead of the Application?
control.Resources.MergedDictionaries.Clear();
control.Resources.MergedDictionaries.Add(resourceDictionary);
(answering my own question)
The way to load a resource dictionary as a theme is to add it to the list of merged dictionaries of the generic.xaml resource dictionary.
There is no other way to load a resource dictionary as a theme.
This works fine when used from WinForms

How to style the thumb of wpf slider?

I read about style here:
http://msdn.microsoft.com/en-us/library/cc278073(v=VS.95).aspx
I created a UserControl with slider and UserControl.Resources section. I paste the thumb style but some tag are not recognized like vsm:VisualStateManager (I'm using VS2010) why ?
That is the documentation for Silverlight. You probably want the documentation for WPF:
Slider Styles and Templates
Edit:
Just to be clear, if you are using Silverlight, you should use Silverlight templates and styles; if you are using WPF, you should use WPF templates and styles.
In any case, the VisualStateManager is a full-fledged part of both Silverlight4 and WPF4, so if you see a template with the "vsm:" namespace, the simplest option is to just remove the prefix where-ever you see it.

WPF design-time context menu

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

WPF XAML Style Gallery

WPFThemes is a good resource for WPF themes and styles. As of now they do not cover many controls like
Window
Popup
Datagrid
etc..
Is there any other resource to help developer in styling a WPF application?
Please check out the Microsoft Expression Gallery to see if that helps you out. There are several types of window and button styles there.

Resources