styles

Grow height of parent div that contains floating nested divs

谁说我不能喝 提交于 2019-12-28 10:45:26
问题 I can’t seem to auto-grow my parent div ’s height based on its floating child div s. All the children are floating, to take up space horizontally, and then wrapping to the next line. There can be a changing number of floating children, and the parent has to auto-size its height. (The parent div serves as a background for all the floating div s). There is also a second div below the parent div that needs to be pushed down, so that it is below the floating div s. It’s of major importance that

Why is the Button's Background changing?

主宰稳场 提交于 2019-12-28 06:25:13
问题 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"> <Grid> <Button> <Button.Style> <Style TargetType="{x:Type Button}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Green"/> </Trigger> </Style.Triggers> </Style> </Button

What's the difference between windowBackground and background for activities style?

纵然是瞬间 提交于 2019-12-28 05:50:06
问题 I have a background set for all of the activities of the app by using the "android:background" parameter in the styles and setting the theme of the application to link to this style. All worked well, till I've noticed that for a dialog with a list of items, it makes each item to have the full size of the background . After changing the parameter being used to "android:windowBackground" it seems to work fine in this case too. Why does it occur? What is the difference between the two? Also ,

How can I achieve a dashed or dotted border in WPF?

十年热恋 提交于 2019-12-28 05:07:06
问题 I have a ListViewItem that I am applying a Style to and I would like to put a dotted grey line as the bottom Border . How can I do this in WPF? I can only see solid color brushes. 回答1: This worked great in our application, allowing us to use a real Border and not mess around with Rectangles: <Border BorderThickness="1,0,1,1"> <Border.BorderBrush> <DrawingBrush Viewport="0,0,8,8" ViewportUnits="Absolute" TileMode="Tile"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="Black">

How can I achieve a dashed or dotted border in WPF?

◇◆丶佛笑我妖孽 提交于 2019-12-28 05:07:05
问题 I have a ListViewItem that I am applying a Style to and I would like to put a dotted grey line as the bottom Border . How can I do this in WPF? I can only see solid color brushes. 回答1: This worked great in our application, allowing us to use a real Border and not mess around with Rectangles: <Border BorderThickness="1,0,1,1"> <Border.BorderBrush> <DrawingBrush Viewport="0,0,8,8" ViewportUnits="Absolute" TileMode="Tile"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="Black">

How do I dynamically bind and statically add MenuItems?

北慕城南 提交于 2019-12-28 03:40:08
问题 I'm binding the ItemsSource of my MenuItem to an ObservableCollection in my ViewModel. Here is my xaml: <MenuItem Header="_View" ItemsSource="{Binding Windows}"> <MenuItem.ItemContainerStyle> <Style> <Setter Property="MenuItem.Header" Value="{Binding Title}" /> </Style> </MenuItem.ItemContainerStyle> </MenuItem> This part works great, but now I also want to add some static MenuItems to the same View MenuItem, separated with a separator. Something like this, even though I know this won't work

Remove Control Highlight From ListBoxItems but not children controls

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 18:21:40
问题 I am using a ListBox to display a list of items: PictureOrders. I have applied a DataTemplate for the ListBox's Items. I would like to style the list box so that the items are not highlighted when the mouse is over any of the items in the list box and so that the selected item in the list box is not highlighted either. So, I used the following in the ListBox's resources: <ListBox.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />

curved style for image

大憨熊 提交于 2019-12-25 16:37:31
问题 How to design the curved style for the image in 3d! The original image has to be show like below image. Because In 3d rotation I need to show it in dynamically like the below image. For editing in Photoshop for each image has take much time so it need to be manipulate at run time. div.img img{ margin: 5px; padding: 5px; height:250px; width: 500px; float: left; text-align: center; } <div class="img"> <img src="http://po-web.com/wp-content/uploads/2013/12/it-solution1.jpg" alt="Klematis"> </div

Accessing an element defined in a style's template in wpf?

两盒软妹~` 提交于 2019-12-25 16:12:51
问题 I have a wpf TabControl which I added a ScrollViewer to. This is all wrapped into a style which is situated in a resource dictionary. Now, on the window's xaml side, all I do is set . I would like to access the control viewer element, as defined in the style as follows: <Style x:Key="MyTabStyle" TargetType="{x:Type TabControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabControl}"> <ScrollViewer /> ....... How do I access the ScrollViewer which is so

Focus on Label, TextBlock and Border

十年热恋 提交于 2019-12-25 12:47:10
问题 I want to create a flat button with rounded right top and bottom corners. This button needs to have the background changed on clicked and on mouse over. Currently my Markup looks like this: <Border x:Name="MyButton" Height="25" Margin="0,5,0,0" CornerRadius="0 5 5 0" BorderThickness="1" BorderBrush="Gray" Style="{StaticResource myStyle1}"> <StackPanel Orientation="Horizontal" Margin="8,0,0,0"> <Image Source="image.jpg" Height="20"/> <TextBlock Text="My Button"/> <!-- Could also be a label if