controltemplate

Silverlight custom control inheritance. Reusing the template?

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 ... ...

Button control template with resizable circle

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...

Is there any way to access the control templates used by office 2007

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) ...

Raise and consume AttachedEvent on button click

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...

How can the ViewModel drive a ControlTemplate?

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...

WPF Setting on a Control Template

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...

WPF Document Viewer Styling

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. ...

WPF ToolTip ControlTemplate access defining element properties

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...

Custom ProgressBar ControlTemplate

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...

Styling TabItem when populated with ItemsSource

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}"/> ...

MouseOver Trigger firing on ContextMenu with overridden ControlTemplate. Where is it coming from?

I have this very simple ControlTemplate: <ControlTemplate TargetType="{x:Type ContextMenu}"> <Border Name="Border" Background="{StaticResource BlueBackground}" BorderBrush="LightBlue" CornerRadius="10" ...

WPF ComboBox ControlTemplate Background problem

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) ...

Default custom ControlTemplate is not applied when using Style

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... --> ...

WPF ComboBox ControlTemplate Background IsMouseOver

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...

Problem with derived ControlTemplates in WPF

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...

Image shows in Expression Blend but not during runtime

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...

How to start a ColorAnimation from a MultiTrigger in a ControlTemplate ?

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...

RectangleGeometry with relative dimensions... how?

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...

When overriding WPF templates do I have to override each theme's template separately?

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...

Multibinding File-Paths into a Button ControlTemplate

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...