styles

How can i change the default values of the Binding Option in WPF?

人盡茶涼 提交于 2020-01-04 03:59:07
问题 In my current project i'm using several textbox controls whose content is filled from objects which are coming from a database. The object uses validation to validate the correct insertion of the text. When i want to show a validation error (i.e. the text has to many characters) i have to add some binding options to the text property like in the following line: <TextBox Text="{Binding Mode=TwoWay, Path=Description, ValidatesOnDataErrors=True, NotifyOnValidationError=True, UpdateSourceTrigger

Why is a DOM element null? [duplicate]

会有一股神秘感。 提交于 2020-01-03 17:34:46
问题 This question already has answers here : Why does jQuery or a DOM method such as getElementById not find the element? (7 answers) Closed 3 years ago . I have this simple HTML file: <!DOCTYPE html> <html> <head> <script src='test.js'></script> </head> <body> <p>I am a paragraph tag</p> <h1 >I am an h1 tag</h1> <div id="id"> I am a div tag</div> </body> And this simple script (test.js): y=document.getElementById("id"); y.style.color="green"; Why on earth is "y" null? The error I'm getting is

How to apply WPF ScrollBar style to a particular listview?

[亡魂溺海] 提交于 2020-01-03 16:53:15
问题 Ok, here is my scrollbar style. <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}"> <Setter Property="Background" Value="#D5E0FF" /> </Style> If I apply this, all scrollbars in my application will get affected, undoubtedly. Now I have 2 listview(s) in my application, I need to apply this style to only a particular listview, while another one remain default scrollbar, any idea? This is driving me crazy. Thanks. 回答1: Add the style as a resource to the ListView itself. <ListView>

How to apply WPF ScrollBar style to a particular listview?

一笑奈何 提交于 2020-01-03 16:50:54
问题 Ok, here is my scrollbar style. <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}"> <Setter Property="Background" Value="#D5E0FF" /> </Style> If I apply this, all scrollbars in my application will get affected, undoubtedly. Now I have 2 listview(s) in my application, I need to apply this style to only a particular listview, while another one remain default scrollbar, any idea? This is driving me crazy. Thanks. 回答1: Add the style as a resource to the ListView itself. <ListView>

Android Preference Category Styling

回眸只為那壹抹淺笑 提交于 2020-01-03 10:41:10
问题 I am trying to change the color of the text and the background of the preference categories. I searched the webs for answers, but nothing seems to be working. Has anyone successfully changed the color of the preference category attributes? Could I use a custom layout to change looks and feel of the preference category? I need some more direction. Please help Here is what I have so far: <style name="Theme" parent="@style/android:Theme.Holo.Light"> <item name="android:actionBarStyle">@style

Custom Menu WPF(XAML)

假装没事ソ 提交于 2020-01-03 04:00:11
问题 We have dev in our service, a link between wpf xaml with powershell scripts. Actually, we really not have any hard difficults for every simple controls like textbox, richtextbox, button, etc... But right now, we want trying to make a menu like notepad for example(file, edit, etc...). The objective is to have a menu style like that : Black Menu I have read many threads here and in other website about styling but nothing working(many code are used with the C# so it's complicated to modify it).

Setting SystemColors overrides in an implicit style

泪湿孤枕 提交于 2020-01-02 11:05:45
问题 In my application, I have a bunch of ContextMenus, and I want them all to have the same look, which is quite basic, but it uses the resources to set HighlightBrushKey and ControlBrushKey, which are SystemColors. It looks like this: <ContextMenu Padding="0" Background="Transparent"> <ContextMenu.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </ContextMenu

Setting SystemColors overrides in an implicit style

走远了吗. 提交于 2020-01-02 11:05:13
问题 In my application, I have a bunch of ContextMenus, and I want them all to have the same look, which is quite basic, but it uses the resources to set HighlightBrushKey and ControlBrushKey, which are SystemColors. It looks like this: <ContextMenu Padding="0" Background="Transparent"> <ContextMenu.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/> </ContextMenu

android:@Theme.Translucent Locks orientation to Portrait?

烈酒焚心 提交于 2020-01-02 07:39:25
问题 I've created a new style to set the background as transparent, but for some reason ever since the app doesn't change layout to landscape when device is rotated. Should I specify something in the new style ? Here is it's code : < style name="Transparent" parent="android:@Theme.Translucent"> < item name="android:windowBackground">@color/background</item> </style> 回答1: While you are not specify android:screenOrientation for activty, android uses "unspecified" default value, which means that the

Why does binding affect height?

橙三吉。 提交于 2020-01-02 07:00:35
问题 Style definition in Resources/Shared.xaml ( updated ): <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:Double x:Key="fullHeight" >26</system:Double> <system:Double x:Key="halfHeight" >16</system:Double> <Thickness x:Key="m">10</Thickness> <Style TargetType="Button"> <Setter Property="FontSize" Value="{StaticResource fullHeight}"/> <Setter