I'm trying to create a application that will be tabbed where each tab will have a button area and a view area.
Now each tab will essentially have the same layout just different things in the layout and I wanted to be able to reuse the same layout so that I won't have to change at many places ( it's just not good programming ). Can I acc...
I've been searching for how to change the text color of a selected item in a list box that has lost focus.
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>
<SolidColorBrush x:Key="{x:Static SystemColors....
Still fooling around with WPF and learning as I go. Trying now to build a dynamic grouping of controls ( mostly buttons but might include checkboxes and others ).
I had no idea what was the best way to do this so I tried creating a ItemsControl style and then add the items into a itemspresenter inside a wrappanel. Soon realized the item...
This is my XAML fragment:
<StackPanel Orientation="Horizontal" >
<CheckBox Content="Sunday" IsChecked="{Binding Sunday}" Style="{StaticResource ResourceKey=GridChecks}"/>
<CheckBox Content="Monday" IsChecked="{Binding Monday}" Style="{StaticResource ResourceKey=GridChecks}"/>
<CheckBox Content="Tuesday" IsChecked="{Binding...
Can I do something like this?
<GroupBox.Header>
<GroupBox.Header.Resources>
<Style TargetType="Label">
<Setter Property="Foreground" Value="White"/>
</Style>
</GroupBox.Header.Resources>
...
My WPF UserControl contains two stack panels and each of them contains labels, text boxes and radio buttons.
I would like to set VerticalAlignment property to Center to all controls in my UserControl with as little code as possible.
Now I have following solutions:
brute force - put VerticalAlignment="Center" in each control
define o...
I have managed to style a rectangle such that there is a fold paper tip image style in top right corner side. My requirement is I need to have style with multi-document view image. I can able to achive this below xaml. Now I need to set fold paper tip image style.
Thanks in advance.
RamaS
<Window x:Class="ExpandTreeViewWPF.Window2"
...
Hi All,
I am attempting to create a Tab Control Style that basically looks like buttons at the top that are centered and content panel below that displays the tabitem content.
I have am kind of new to templates but what I have so far works very well except one thing. I want to be able to set the default forground color for text element...
I'm restyling a button, and that includes providing a controlTemplate and also adding some triggers (for mouseenter and mouseleave).
My XAML is as follows:
<Style TargetType="Button">
<Style.Resources>
<Color x:Key="ForeColour" R="128" G="128" B="128" A="255"/>
<Color x:Key="BackColour" R="211" G="211" B="211" A="...
I have a got a small issue with the wpf project I am currently working on. I am new to WPF. In my app.xaml I am using the Microsoft Aero theme for my application. I have got something like this in my app.xaml
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramew...
Hello!
The LightSwitch look beautiful to me, and I'd like to implement these themes to my WPF apps as well.
Is there a way I can mimic the LightSwitch themes to my app?
...
I have a styled listbox. Listbox items change color when hovered over and when selected. Hover and select work fine. But when selecting an item then taking the mouse off it and coming back to hover over it causes it to go back to hover/unselected state even though it is still selected. How can I keep the listboxitem in a "selected" visua...
I have the following style defined...
<!-- Blue Button -->
<Style x:Key="BlueButton" TargetType="{x:Type Button}">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="border"
BorderThickness...
Hello,
i have created a UserControl to make a ImageButton. But i replaced the the UserControl Item with a Button.
< Button x:Class="myimagebutton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:imagebutton">
<Grid x:Name="grdButton...
Is there a way to change(and apply) a style dynamically in WPF?
Say I have the style declared in XAML:
<Style TargetType="local:MyLine"
x:Key="MyLineStyleKey" x:Name="MyLineStyleName">
<Setter Property="Fill" Value="Pink"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
...
When I have my button's content as a normal string e.g. <Button Content="Ok" /> then button behaves as normal. But if I change the content to have a keyboard accelerator e.g. <Button Content="_Ok" /> the button's style changes to have different margins and sizes.
I have a TextBlock style that doesn't have a key so is being applied to al...