styles

WPF: Change padding depending of container ?

I have UserControl named MyUserControl, and another UserControl named MyContainer. I want MyUserControl to have padding 10 if it is placed inside MyContainer and 15 otherwise. Shortly, I want <MyContainer> <MyUserControl> Hello </MyUserControl> </MyContainer> to look like <MyContainer> <UserControl Padding="10"> Hello ...

CSS style like Windows Seven/Vista

I need to create a web application using ASP.NET MVC, jQuery and web standards for a customer with a style which look like Windows Vista/Seven. Can anybody indicate me a link to do this with CSS? I have searched on the web, but I couldn't find it. I'd like to have interface elements like "window", "menu", "buttons", "form controls", etc...

Can I use a static variable from a Java class in res/values/styles.xml?

I want to refer to a static Java variable in my styles.xml, is that possible? Here's a pseudo-xml example: <style name="Artwork"> <item name="android:background">@drawable/border_{Constants.MY_COLOR}</item> </style> ...

Generic CSS templates anywhere (not layout)?

I am looking for a place where I can download a bunch of CSS stylesheets to change the appearance of my titles, links, paragraphs, etc. I am not an artist, so I am hoping to leverage other people's skills in choosing the right fonts, colors, sizes, etc. I do not want to include layout because then it won't be as generic. Does anyone kno...

WPF Styles Button MouseOver Question.

Hi, I am trying to make a simple mouseover effect on a button, It does change the color when mouse is over but the color is immediately changed to the default button background... how can I override this behavior? this is my code: Style myBtnStyle = new Style(); Trigger bla = new Trigger() { Property = IsMouseOverProperty, Value = true...

Why can't the style I have within a control template use templatebinding?

I have this control template that I am writing: <Style TargetType="{x:Type controls:InfoBar}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type controls:InfoBar}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBindin...

WPF: adding Style to a slider

Hi I am using a Slider and putting a style element over it as follows... But however, I am not able to figure out why the style is not getting reflected. The RepeatButtons are not still visible. Thanks in advance <ResourceDictionary> <LinearGradientBrush x:Key="Stroke_Gradient" EndPoint="0.5,1" StartPoint="0.5,0"> ...

When should I use temporary variables?

Specifically, I'm wondering which of these I should write: { shared_ptr<GuiContextMenu> subMenu = items[j].subMenu.lock(); if (subMenu) subMenu->setVisible(false); } or: { if (items[j].subMenu.lock()) items[j].subMenu.lock()->setVisible(false); } I am not required to follow any style guidelines. After o...

Setter for Canvas.Left and Canvas.Top readwrite in WPF but not in Silverlight 4, why ?

Hi, I have the following XAML, which works fine in WPF, but not in Silverlight 4 <ItemsPanelTemplate x:Key="ContentListBoxItemsPanelTemplate"> <Canvas/> </ItemsPanelTemplate> <DataTemplate x:Key="ContentListBoxItemTemplate"> <Border CornerRadius="15" Width="150" Margin="3" Height="300"> ...

WPF Button Styling with OuterGlowBitmapEffect

I have managed to style a button such that there is a the background I wanted (Normal). However, I want to create an OuterGlowBitmapEffect on the content. Also, when I modify the style, it reverts to the default for MouseOver, Pressed, and HasFocus. Here is the image of what I want, how could you do this using WPF Styles http://tinypic...

WPF ListBox's scrollviewer customizable so that there is no Scrollbar, only RepeatButtons

Hi I would like to customize the scrollbars of a listbox's scrollviewer in such a way that the scrollbar only consists of a RepeatButton for scrolling up and a Repeatbutton for scrolling down. Nothing else. There should be no scrollbar (track) between the buttons. One button should be to the left of the ItemsPanel (scroll up) and the oth...

Change Rectangle Fill Based on ColumnWidth of a grid

Essentially i want to do as the title says, if the columnwidth is .50 then the rectangle should be red, if it's .75 then it should be amber, and if it's 1 then it should be green. I thought I could achieve this with DataTriggers but for some reason I am getting "Object Reference Not Set To An Instance Of An Object" error, here is my cod...

Set Window Properties based on Datatype of UserControl

I've got a simple window, that is container for various views. I've got a DataTemplate that shows the correct view based on whatever the window's MainViewModel property is set to. <DataTemplate DataType="{x:Type VM:StartupViewModel}"> <AdornerDecorator> <V:StartupView /> </AdornerDecorator> </DataTemplate> What I'd li...

Silverlight: TextBlock has no Template property?

Guys, I want to customize the look of a TextBlock. (I want a rounded rectangle border around it). But I'd like to be able to set it's template via the app.xaml But I see that TextBlock doesn't have a Template property. I'd use Label (which does have a Template property) but I guess silverlight doesn't support a Label control. So what ...

ReportViewer ASP.NET Adding spaces in a cell

I am using ReportViewer 2008, with ASP.NET and C#. I have a cell in a matrix table. I'm interested in formatting the insides of the cell so that as if there was another table in there - I'm talking about the very top left of the matrix report. However I cannot add a table - this would cause rendering issues which will prevent the cel...

Why does VerticalScrollBarVisibility not work in a style in Silverlight?

VerticalScrollBarVisibility works when I define it inline like this: <UserControl x:Class="TestScrollBar.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas....

Silverlight and WPF Storing styles in a seperate DLL.

Is there a clean way to store styles in a separate assembly so they can be used by Silverlight and WPF? In an ideal world I would like to have MyCompany.Styles.dll. The styles would be shared between multiple WPF and Silverlight projects. ...

How to apply styles to all windows in WPF app?

I have the following App.xaml file: <Application x:Class="MiniDeviceConfig.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MiniDeviceConfig.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> ...

WPF compile error "IDictionary must have a Key attribute"

I've created control styles I want to use among multiple xaml pages in my WPF app. To do this I created a Resources.xaml and added the styles there. Then in my pages I add this code <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,...

Android layout with sqare buttons

I want to make a layout similar to this one: Four square buttons on the screen - each of those using half of the screen with/screen height (whichever is smaler). Independent of screen size/resolution. I already tried to achieve this by using a LinearLayoutbut the buttons are ending up using the correct width, but still having the hei...