FAQ Database Discussion Community

Resize Columns of Styled WPF DataGrid

I have DataGrid with custom style, I'm having trouble in re-sizing columns because it only works when the cursor is EXACTLY between the two columns Here's the part of style that sets the DataGridColumnHeader <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="Foreground" Value="White"/> <Setter Property="FontFamily" Value="Segoue UI"/>...

XamlWriter skips “x:Name” attribute while saving ResourceDictionary

Here's custom style: <Style TargetType="{x:Type Button}"> <Setter Property="Focusable" Value="false" /> <Setter Property="Background" Value="{StaticResource AppBackBrush}"/> <Setter Property="Foreground" Value="{StaticResource AppBrush}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border BorderBrush="{StaticResource AppBrush}" Name="content" BorderThickness="1" CornerRadius="3" Background="{StaticResource AppBackBrush}" > <Grid...

Reuse of styles and templates

I have been working on several Wpf projects. In every project we needed to style the default Wpf controls (e.g. Button). Everytime we started on a new project we built our templates and styles from scratch - or simply copied them from one assembly to another. Because I hate copying...

How to style a WPF ToggleButton like star button

appbar_star static resource is the designed star from modern-icons StarToggleButtonStyle <Style x:Key="StarToggleButtonStyle" TargetType="ToggleButton"> <Setter Property="Foreground" Value="White"/> <Setter Property="BorderBrush" Value="Black"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToggleButton"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding...

Changing color of positionmarker/caret

What is the name of the element of a text box control which I need to manipulate to achieve a change of the color of the position marker in the text box? The normal foreground attribute changes the actual texts color, but the position marker stays the same color.