Hi, i have the following scenario:
[TemplatePart(Name = GoToEditModeButtonPart, Type = typeof(DoubleClickButton))]
public class ValueBoxWithLabel : ContentControl
{
public const string GoToEditModeButtonPart = "GoToEditModeButtonPart";
#region LabelText Dependency Property ...
#region IsInEditMode Dependency Property ...
...
I am learning about control templates in WPF and checking out how to replace the button look with custom template styles. I see that to make a circle button, a Ellipse has to be defined with the same height and width.
<Style x:Key="Button2" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<Control...
In WPF, the default scrollbars are boring light blue controls, however I noticed that Office 2007 has some really nice scrollbars with animated color transitions.
Does Microsoft provide these visually pleasing scrollbars in WPF? (Via a template or any other method)
...
I am trying to raise a custom built attached event on a button click. If I add handlers in the code, they are hit when the button is pressed but if I use the event in a WPF Trigger for animation, it doesn't work.
The Triggers that use the custom Attached Event is defined in a ControlTemplate for a CustomControl.
The same code works fo...
I have the problem that parts of the TreeView Controltemplate need to change depending on the state of the bound (ItemsSource) ViewModels. For example the little expander icon needs to be exchanged with a different drawing based on each items ViewModel state. Additonally based on the state of each ViewModel the child items need to be arr...
Hi,
General question. I have a ControlTemplate that is reasonably complex. Several TextBoxes etc.
I can't use TemplateBinding to bring all the properties to the surface so that I can set all the styles.
Is there a way for a Style to 'delv' into the controls within a control to set values?
Hope my question is clear without an example...
I am trying to restyle the document viewer in WPF and I have restyled everything but the tool bar at the bottom. The problem I having is figuring out how to style the toolbar at the bottom and its child controls. Does anyone know how to restyle this?
Thanks.
...
Hi,
I am restyling the default tooltip by creating an Application level typed style resource which applies to every tooltips. In the tooltip ControlTemplate, I need to access (Binding to) a property value from the element which defines the actual tooltip. The defining element can be of any type. Binding RelativeSource FindAncestor works...
Hi All,
I am having a little difficulty with a generic template for my extended progress control. Basically, the template consists of a grid, with some text information and the actual progress bar.
It works fine, except for when I want to switch to vertical orientation. Everything appears to be rotated correctly, but I get no progres...
Hi. I'm using a WPF Tabcontrol populated with a collection using Itemssource.
<TabControl x:Name="_tabControl" ItemsSource="{Binding TabViewModelList}">
<TabControl.ItemContainerStyle>
<Style TargetType="TabItem">
<Setter Property="Header" Value="{Binding TabCaption}"/>
...
I have this very simple ControlTemplate:
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border
Name="Border"
Background="{StaticResource BlueBackground}"
BorderBrush="LightBlue"
CornerRadius="10"
...
This is an example of a ComboBox's ControlTemplate.
CLICK HERE
I've tried to set the Background / add a trigger to change the background when the ComboBox is focused (with a tab key for example),
both without success.
I don't even understand why it isn't included by default !
(compared to the original generic template)
...
Hi all,
I have created a default style for a Button including a custom ControlTemplate like so:
<Style TargetType="{x:Type Button}">
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="Black"/>
<!-- ...other property setters... -->
...
I have the following style defined which is being applied (as text changes to red) but I cannot seem to get the Background property to work. Can anyone tell me what is wrong with this?
<Style x:Key="CompanyComboItemContainerStyle" TargetType="ComboBoxItem">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Sette...
The following xaml code works:
<Window x:Class="DerivedTemplateBug.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DerivedTemplateBug"
Title="Window1" Height="300" Width="300">
<Button>
<Button.Template>
<ControlTemplat...
The image in question is located in a ControlTemplate inside of a ResourceDictionary similar to this (various details removed for clarity):
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/express...
Hi all
I have the following ControlTemplate for a WPF TabItem:
<ControlTemplate x:Key="DefaultTabItemTemplate" TargetType="{x:Type TabItem}">
<ControlTemplate.Resources>
<SolidColorBrush x:Key="UnselectedForegroundBrush" Color="#414141" />
<!-- Unique color for this template -->
<SolidColorBrush x:Key="Selec...
I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating.
The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent rectangle with a rectanglegeometry.
The problem is that I don't know how to define a relati...
I have a requirement to change a very small part of the WPF ComboBox's template.
If I take a copy of the existing template for the Luna theme and make the change it all works fine initially. But if the user has a different theme, my ComboBox retains it's custom theme, (Which is obviously based on Luna) so looks out of place.
Is there a...
I am trying to develop an application that uses a number of images that are stored in a seperate remote file location. The file-paths to the UI elements are stored within the Application Settings. Although I understand how to access the images from Applications Settings using a MultiBinding and a value converter, I'm not sure how to inte...