Questions tagged [control-template]

The ControlTemplate allows you to specify the visual structure of a control. The control author can define the default ControlTemplate and the application author can override the ControlTemplate to reconstruct the visual structure of the control.

The ControlTemplate allows you to specify the visual structure of a control. The control author can define the default ControlTemplate and the application author can override the ControlTemplate to reconstruct the visual structure of the control.

A ControlTemplate is a powerful WPF mechanism to (re)define the visual layout of any control. The template replaces the control's visual tree with the content of the template. Control templates often appear in WPF themes, where the visual layout of controls such as buttons are applied globally or regionally.

15 questions
33
votes
1 answer

WPF ListBox, how to hide border and change selected item background color?

I'd like to hide the border of ListBox, and make background of selected item the same as unselected ones. How do I do this?
deerchao
  • 10,454
  • 9
  • 55
  • 60
7
votes
2 answers

TemplateBinding from a Style DataTrigger In ControlTemplate

In the following XAML I'm using a Rectangle with a Border as the Template for a ToggleButton. I want the BorderBrush to be a different colour to reflect the changing value of ToggleButton.IsChecked. Unfortunately my attempt here of using a…
Grokodile
  • 3,881
  • 5
  • 33
  • 59
4
votes
2 answers

Silverlight 4 : Making Closeable Tabitems

I would like to extend the tab control to have closeable tab items. I have found this WPF solution of Kent: On the WPF TabControl - can I add content next to the tab headers? I opened a copy of the existing silverlight tabcontrol in Blend. However…
Houman
  • 64,245
  • 87
  • 278
  • 460
3
votes
1 answer

how to get the default style and control template of WP7 control?

they have the styles and templates for WPF and Silverlight controls published on MSDN. but not for the WP7 controls. So, how to get the default style and control template of WP7 control ?
3
votes
3 answers

WPF ComboBox that shows nothing selected when disabled (IsEnabled == false)

I'm thinking out different ways to have a WPF ComboBox show blank as if nothing is selected when IsEnabled is set to false. Like always I'm trying to do this without having to redefine the whole control template for the ComboBox which is always a…
jpierson
  • 16,435
  • 14
  • 105
  • 149
3
votes
1 answer

Changing color of the GeometryDrawing Brush when Button is pressed

I created a Button Template. There are an Image and a Label. The Source of the Image is in a ResourceDictionary Pictures. The Source of the picture is a DrawingImage with White brush color.
Pavel Etrich
  • 69
  • 2
  • 9
2
votes
2 answers

Xamarin Forms shared ControlTemplate for ContentPage and CarouselPage

I'm stuck trying to reuse an control template for a independent ContentPage as well as a ContentPage in a CarouselPage... The main problem is that the CarouselPage doesn't support the ControlTemplate property. Therefore I'm forced to insert a…
1
vote
1 answer

WPF - Control Template and control visibility based on data

I am using Control template to display listbox items. I want to set the visibility of the control based on the item value. I need the same as How can I replace an image in a WPF grid with another control depending on the source data? How to include…
Geeth
  • 5,282
  • 21
  • 82
  • 133
1
vote
2 answers

Passing values to Control Template dependency property

How can I set the value of CornerRadious in Control template value taken from the custom control definition ... Please help XAML for User Control Is
Saneesh
  • 33
  • 5
1
vote
1 answer

Checked status not updated in CheckBox template

I'm trying to create an hyperlink that changes its text depending on a boolean value. I thought I could leverage the IsChecked method of a CheckBox. So I wrote this ControlTemplate for a CheckBox:
Simon
  • 9,255
  • 4
  • 37
  • 54
1
vote
2 answers

How to modify ControlTemplate to add items directly to my custom control

I have defined following control template for my custom control.
Ponraja
  • 570
  • 2
  • 6
  • 17
0
votes
1 answer

WPF TreeViewItem Control Template Partially applied?

I know a ControlTemplate is suppose to replace the default one entirely and this seems to work when not using a HierarchicalDataTemplate. However using a HierarchicalDataTemplate my control template seems to be partially used - the TreeViewItem is…
markmnl
  • 11,116
  • 8
  • 73
  • 109
0
votes
1 answer

TemplateBinding + SIlverlight 4 + Default Style

I have written a content control with an Int Dependency Property in the content Control. The Control has a default style which contains the Template for the control. Now the problem i face is, No matter what the dependency property's value is ,…
0
votes
0 answers

Template the content control for multiple types - radio button and tabitem

So, what I set out to do is template my radio buttons and tab items to look the same so that they look the same but can act differently. SoIi created a Control template and targeted it to the Content Control type and used it as a static resource to…
NotARobot
  • 978
  • 2
  • 14
  • 36
0
votes
1 answer

How to use content template for ComboBox content presenter?

In the following file, there is example for COmboBox - control template. http://msdn.microsoft.com/en-us/library/ms752094(v=vs.85).aspx I tried to add a content template for content presenter using following XAML. But it displays value "1" as…
Relativity
  • 6,690
  • 22
  • 78
  • 128