styles

ASP.NET MenuItem Individual Styles

北战南征 提交于 2019-12-17 19:34:55
问题 I'm hoping to use an ASP.NET Menu Control for navigation through my site. However, I've got a requirement that each MenuItem must be styled differently (different colors, both static, and onHover). Without creating a custom class that would inherit from MenuItem, is this possible? Thoughts on a better solution? 回答1: Short of overriding RenderContents on Menu, your options are very limited. Most of what you'd need is private and sealed and you won't get anywhere there. My solution would be to

Error: 'Cannot create unknown type '{clr-namespace:NameSpace.Properties}Settings'.'

旧巷老猫 提交于 2019-12-17 18:25:58
问题 I define my settings and styles in a ResourceDictionary: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:properties="clr-namespace:Kavand.UI.Properties"> <ResourceDictionary.MergedDictionaries> <ResourceDictionary> <properties:Settings x:Key="settings" /> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> <Style x:Key="PopupMenu_StackPanel"> <Setter Property="TextBlock.FontSize"

What is the easiest or fastest way to make CSS render the same in all browsers

馋奶兔 提交于 2019-12-17 17:27:17
问题 Making a web page display correctly im all major browsers today is a very time consuming task. Is there a easy way to make a CSS style that looks identical in every browser? Or at least do you have some tips to make this work easier? 回答1: I agree with all the "reset" suggestions and the "grid" framework suggestions, but I did want to add a bit of advice: The goal of identical in every browser is, in practical terms, unachievable because you cannot control the client. Case in point: fonts. You

Cut-out text with CSS

浪尽此生 提交于 2019-12-17 16:58:38
问题 I try to create a hover effect for a button in CSS. Basically text should be 'cut out' of its parent element, making it see-through to the sites background. I'd do the stripes with a gradient, but my problem is to add transparency to the font. I looked at background-clip, but that would do the opposite of what I try to achieve, and would make things way more complicated. Is there an easy way to accomplish this effect? I don't mind using JS, but no jQuery if possible. 回答1: to follow my comment

Do custom CSS properties use one leading dash or two?

大憨熊 提交于 2019-12-17 16:51:15
问题 #elem { -myCustom: 99; } OR #elem { --myCustom: 99; } I have seen both of the above used in examples online. What the difference between the two? Trying to access custom properties in JavaScript returns null.. #elem { -myCustom: 99; } <div id="elem">some text</div> elem = document.getElementById("elem"); style= window.getComputedStyle(elem); value = style.getPropertyValue('-myCustom'); alert(value); 回答1: single leading dash is used for vendor prefixes double leading dash is used for defining

Android:How can I set the AlertDialog width and height,and the button of the AlertDialog style?

风格不统一 提交于 2019-12-17 16:28:52
问题 I have a task to change the AlertDialog width and height by xml,I want make that become style,so I can use it easy.And that ,I need to change button of AlertDialog style also.Can you tell me a way to achieve the target。Thank you Very grateful。 PS,I'd better achieve the target by change xml。 回答1: There are two methods 1) programatically 2) By using xml layout 1)=======> AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setView(layout); builder.setTitle("Title"); alertDialog

Pandas style function to hignlight specific columns

只愿长相守 提交于 2019-12-17 15:51:49
问题 I have been trying to write a function to use with pandas style. I want to high columns that I specify in the arguments. This is not very elegant but for example: data = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC')) def highlight_cols(df, cols, colcolor = 'gray'): for col in cols: for dfcol in df.columns: if col == cols: color = colcolor return ['background-color: %s' % color]*df.shape[0] then call with: data.style.apply(highlight_cols(cols=['B','C'])) I get an error: ("'Series'

wpf datagrid alternate row coloring

戏子无情 提交于 2019-12-17 15:46:36
问题 I have tried this method.. without luck.. <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <Trigger Property="ItemsControl.AlternationIndex" Value="0"> <Setter Property="Foreground" Value="Red" /> </Trigger> </Style.Triggers> </Style> Is there a way to get the row Index? I have even tried <DataTrigger Binding="{Binding AlternationIndex}" Value="0"> <Setter Property="Foreground" Value="Green"></Setter> </DataTrigger> 回答1: Unless already done, you have to set the AlternationCount

How can I create a group footer in a WPF ListView ( GridView )

倾然丶 夕夏残阳落幕 提交于 2019-12-17 15:24:09
问题 I have a ListView that displays sales orders, and groups them by status. In WinForms I had a footer at the bottom of each group that displayed the Total sale price for each group, and I would like to do the same in WPF. I have figured out how to group the orders, but I can't figure out how to create a footer. This is my current group style: <ListView.GroupStyle> <GroupStyle HidesIfEmpty="True"> <GroupStyle.HeaderTemplate> <DataTemplate> <!--CollectionViewGroup.Name will be assigned the value

Creating a Style in code behind

给你一囗甜甜゛ 提交于 2019-12-17 09:22:18
问题 Does anyone know how to create a wpf Style in code behind, I can't find anything on the web or MSDN docs. I have tried this but it is not working: Style s = new Style(typeof(TextBlock)); s.RegisterName("Foreground", Brushes.Green); s.RegisterName("Text", "Green"); breakInfoControl.dataTextBlock.Style = s; 回答1: You need to add setters to the style rather than using RegisterName. The following code, in the Window_Loaded event, will create a new TextBlock style which will become the default for