styles

IE7 - Floated Image Disappears!

Ok. Here's the situation. I am styling a comments section on one of my websites. Here's an example markup: <ol class="comments"> <li> <a href="/view/profile/id/2"> <img src="/images/photo-thumb.gif" alt="johndoe" /> </a> <p class="pad-top"><em>written on Sunday 2nd of Aug...

Overriding styles in silverlight from XAML fetched from database

Within my App.xaml I have the following segment: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Assets/Styles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> I want to be able to overrid...

CSS Parent/Ancestor Selector

I know this is a shot in the dark, but is there a way, using css only, CSS2, no jquery, no javascript, to select and style an element's ancestor? I've gone through the selectors but am posting this in case I missed something or there is a clever workaround. For example, say I have a table with classname "test" nested inside a div. Is t...

SL3 Shared Path Style

Hi, I have problems applying the following Style to multiple Path-Objects in XAML: <Style x:Key="cloudStyle" TargetType="Path"> <Setter Property="Data" Value="M 410.67959 194.3815 C 392.37515 ...." /> <Setter Property="StrokeMiterLimit" Value="4" /> <Setter Property="StrokeMiterLimit" Value="4" /> <Setter Property="StrokeLineJ...

WPF -- override style colors, best practice

Hello, I have a style for a GlassButton. The problem is that the gradients are built in the style and the colors are set in the gradients. Now, I have a framework for a button that I like but I need different buttons to be different colors. Is there any way I can "expose" one or more of the color properties from the Style to override...

Why is the Button's Background changing?

I'm a rank beginner with WPF and I don't even know where to look to find the answer to this question. This XAML seems very straightforward to me: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid> <Button> <Button.Style> <Styl...

How to override a global style (that doesn't have an x:Key), or alternatively apply a named style to all type-targeted controls?

Hello all! I declared a style that I want to apply to ALL the buttons in the project, the style resides in the ResourceDictionary: <Style TargetType="StackPanel"> <Setter Property="Orientation" Value="Horizontal" /> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>...

Recommend WPF Localization Tool

Can anyone recommend a good WPF localization tool that will do the following: Correctly handle WPF styles Can do binary localization, where no source code is available At least one tool I have tried has failed to generate working satellite assemblies when the source assemblies use WPF styles. ...

Bind page title to a text block in a style

OK, I have defined a style for Navigation Window. I have successfully styled Navigation buttons and even added page breadcrumbs to the Navigation menu. What I want is to add Page title next to the breadcrumbs: Style x:Key="{x:Type NavigationWindow}" TargetType="NavigationWindow"> <Setter Property="SnapsToDevicePixels" Value="true"/>...

Research into Advantages of Having a Standard Coding Style

There are a couple of questions on Stackoverflow on whether there is any research or studies into what is the best coding convention/style. That's not what this question is about. This question is about whether there are any studies that research whether there are any advantages, productivity gains or other positive side effects to hav...

How do I let my UserControls use the same styles as App.xaml?

I have a UserControl with a Border element within it that I want to style with a particular Border style. It compiles but won't start, giving a XamlParseException, saying, "Cannot find resource ..." Is there a way to do this? Thanks. App.xaml: <cal:CaliburnApplication x:Class="WahnamProgressTracker.App" xmlns="http://schemas.microso...

Is it possible to create a Style for a 2x2 Grid in WPF?

I'm trying to do something like this... <Style x:Key="TwoByTwoGridStyle" TargetType="Grid"> <Setter Property="Grid.RowDefinitions"> <Setter.Value> <ControlTemplate> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> ...

Can my WPF Style Setter use a TemplateBinding?

I'm trying to do something like this... <Style x:Key="MyBorderStyle" TargetType="Border"> <Setter Property="BorderBrush" Value="{StaticResource MyBorderBrush}" /> <Setter Property="Background" Value="{StaticResource MyBackgroundBrush}" /> <Setter Property="Padding" Valu...

How to dynamically change the height of a div

How do I dynamically change the height of a div. Why does this not work: var priceBarElement = $("priceBar"); priceBarElement.style.height = request.responseText+"px"; Which I hope to use to change the priceBar div which is given by this line further down. <div id="priceBar" style="width:28px;margin-top:20px;background:#F00"></di...

IE and Transparent Backgrounds

I have the following css: body { background-image: url(images/background.jpg); background-repeat: repeat-x; background-color: #99ccff; } Unfortunately, any div created on this page, now automatically has this colour. None of the following works if applied to any divs on he page (it still takes on the above colour. bacg...

WPF TypeConverter ConvertTo not firing

Hi, I have a dependency property in a class which I need to be converted to a string. I have added the TypeConverty attribute on the property. The type I am converting is the .net Style class. [TypeConverter(typeof(BulletStyleTypeConverter))] public Style BulletStyle { get { return (Style)GetValue(BulletStyleProper...

Looking for Custom <code> & <pre> CSS styles in Wordpress!

I'm looking for a way to customize my < code > and < pre > tags in my blog. I'm in need of custom CSS styles/codes. Anyone able to guide me to a few good examples? ...

Get only the specified styles of an element :)

Hi guys, can you help me ? :( I can get a style of an element just doing this: alert (document.defaultView.getComputedStyle (document.getElementById ("element"), null).getPropertyValue ("background-color")); I can get all styles of an element just doing this: var styles = document.defaultView.getComputedStyle (document.getElementByI...

WPF Collapsed Grid not Styling

So, I have a grid inside a listbox. The purpose is that when the listboxitem is selected, I want the grid to show, having the selected item expand to show more detail information. I set up a style trigger for this and it works great, except for one thing: the labels and textblocks styles are unapplied on the grid. I'm assuming this ha...

WPF - Managing styles and avoiding messy resource dictionaries

Hi, I've spent hours working on an application design in WPF and created a whole bunch of different styles along the way. But I noticed that I actually had just edited the styles in the SimpleStyles.xaml file and not a custom dictionary. So, I started right clicking all controls I could find and selected "edit a copy" and created a copy...