I have a very large silverlight application. I am using a telerik RadGridView control.
I noticed that the header style of the RadGridView is not the standard header as given out of the box by telerik. I.e. the colours are different and the text is different etc.
I first tried to define my own styles and templates (which work in a test project). They are ignored by the RadGridView.
So I started hunting around our application to find out whether a template or style has been applied to make the header different. I couldn't find it.
Are there tools out there that can show me what templates / styles are applied to a particular control and where they come from? A way to debug it in effect.
I am using silverlight spy, but the free edition doesn't show me everything I need.
UPDATE:
I can see what is happening here, a theme is being applied like this,
Telerik.Windows.Controls.StyleManager.ApplicationTheme = new Telerik.Windows.Controls.Windows7Theme();
So the theme must be overiding any template and styles changes that I apply.
Related
I use MaterialDesign and I want to change the appearance of the popup window of a ComboBox.
I did a little research and then came across it here.
change combobox dropdown list background color wpf xaml
Miljac’s answer contains the key MaterialDesignPaper. Is there a documentation of these keys?
I am not being offered keys via IntelliSense.
There is no detailed documentation on the resource keys and where they are used. However, you can have a look at the GitHub repository Wiki. There is a page that lists all the brush names, but it does not provide any information beyond that.
If you want to know which control uses which brushes, you can check the control style list. Pick the control style that you use and it will take you to the XAML style files, where you can identify the used brushes, e.g. for ComboBox see line 548 where MaterialDesignPaper is referenced and the subsequent lines from 553 on where the popup background is bound.
IntelliSense is not reliable when it comes to resource dictionaries e.g. merged into the application resources and resources then being used in a custom view. These are limitations of IntelliSense, the resources may be perfectly available at runtime. The same applies to the designer, it may yield warnings that resources cannot be resolved, but in fact they are available at runtime.
We have a WPF application with multiple teams sharing assemblies to develop an integrated application. Some windows in our application are WPF and XAML.
Today I integrated some DLLs into our application from another team and suddenly, my DataGrid is being styled differently. It is also giving me runtime errors where the DataGrid is showing zero columns, when I know very well that I add columns dynamically in my code during runtime.
What could be causing this?
Is it possible that someone in our team is creating a global style for all DataGrids? Now my DataGrids are being affected?
I am not an expert in WPF but that is my guess. Can this be possible?
Thanks
Yes it is possible, check the other teams for generic styles being put into app.xaml as that seems pretty common, otherwise make sure they know to only style for specific groups (ie a datagrid on a page referencing a particular style for a page/window)
With no more info I cannot help you any further other than to remove the dlls and show it works, then add them and show it doesn't. Make sure your own styles are not enforcing anything onto all datagrids (as that could give you an error if it applies it to any in the DLLs).
I am looking to change the style of a control but I basically want to copy part of a default style. Does anyone know how I can figure out what the default style of a control is?
In my case I am wanting to make the column headers in a DataGrid go blue on mouse over like the row headers do.
You can find some templates that are very close to the defaults on this MSDN site
Another alternative is to get a copy of Expression Blend and use it to make a copy of the default style, however Blend isn't free
Contrary to what Rachel says, the link she provides does not provide the default templates.
I have seen using System.Windows.Markup.XamlWriter.Save(myObject.Template) that the default templates are completely different from what that site shows.
So I am using Silverlight telerik RadScheduler. When creating an appointment using this control an AppointmentDialogWindow pops up. Now, I want to change the look of the window (i.e. its borders, frame etc.)
I am pretty good with Blend but I guess some code - behind will be necessary to set the window style for this Dialog Window.
Any Suggestions?
If you have the full source, go the the specific Theme folder you are looking to implement and grab the SchedulerView.xaml file from there. This is the style file for that specific control.
Reference this resource as a ResourceDictionary in App.xaml or the respective page you will implement the control.
Now when you edit this style sheet it will directly affect how the SchedulerView control operates, including it's child windows.
Warning: this is a cumbersome pain in the neck. Telerik doesn't really like people messing with their styles, and they have acknowledged that they do no typically make it easy for their existing styles to be modified.
Here is how to implement a custom theme:
http://www.telerik.com/help/silverlight/common-styling-apperance-themes-custom-theme-project-telerik-approach.html
I am creating a popup dialog using microsoft's WPF.
The thing is that this popup must support two or more different styles, for instance, depending on how it is called the popup must have a red background and white text in the foreground, or it must have a white background and gray text in the foreground.
What I would like to do is create as many styles as necessary in my xaml file and just choose each of them depending on how the popup was created, therefore I would like to know if it is possible to create something like this (kind of a dynamically applied style) inside the .xaml file, or if it is better to just do this programatically in the code behind.
Also please note that I am using the Visual Studio 2010 with the .NET Framework 4.0.
Thanks,
Felipe
I would define an enumeration that names the styles, then either use DataTriggers to set the style on the control from a wrapping border.