controltemplate Questions

3

Solved

I am running into some issues with styling a radio button in .Net MAUI. Initially, I noticed the the radio button look-and-feel is not consistent across Windows and Android, as can be seen in the i...
Acerbate asked 20/1, 2023 at 23:6

6

Solved

If you set ResizeMode="CanResizeWithGrip" on a WPF Window then a resize grip is shown in the lower right corner, as below: If you set WindowStyle="None" as well the title bar disappears but the ...
Metts asked 4/3, 2009 at 16:17

3

Solved

I am creating a WPF button using Windows 8 styling (formerly metro). I would like the focused state of the button to show with a solid background. When the mouse is over the control, I would like ...
Arch asked 31/1, 2013 at 18:38

2

Solved

When should I choose Style.Triggers and when should I choose ControlTemplate.Triggers? Are there any benefits using one over another? Say I have these styles that achieve the same result: <Sty...
Linstock asked 5/11, 2014 at 23:45

3

Solved

I have the following style definitions: <!-- Border --> <Style x:Key="MyControlBorder" TargetType="{x:Type Border}"> <Setter Property="BorderBrush" Val...
Morehead asked 4/6, 2013 at 6:41

6

Solved

As per this MSDN link, There is no way to replace only part of the visual tree of a control; to change the visual tree of a control you must set the Template property of the control to its ...
Homily asked 23/8, 2010 at 14:7

7

Solved

I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications' assemblies, but it's bette...
Hamate asked 3/12, 2008 at 17:44

2

Solved

I created simple window and applied style to it. Now, when I run application background is black: In XAML it looks normal: What is causing this? Here is XAML code: <Window SizeToContent="W...
Ziegler asked 7/4, 2011 at 9:53

4

<Canvas.DataContext> <ViewModels:VMSomeControl Model="{Binding RelativeSource={RelativeSource TemplatedParent}}" /> </Canvas.DataContext> <!-- DataContext is not...
Overweary asked 7/6, 2010 at 14:39

7

Following the answer to a similar question here, I was able to set the MinWidth on the XAML page. What I would like to do is accomplish this in the control template for all GridViewColumn's in all...
Bracey asked 10/4, 2012 at 22:50

2

Solved

Consider first version of code (MainWindow.xaml): <ScrollViewer> <local:CustomControl1 Width="1000" Height="1000" Background="Red"/> </ScrollViewer> where CustomControl1 deriv...
Baptiste asked 14/8, 2011 at 4:52

7

This is the xaml: <Page.Resources> <ControlTemplate x:Key="WeddingButtonBigTemplate" TargetType="Button"> <Grid> <Image x:Name="imgNormal" Source="../Images/Married_button2...
Mucky asked 1/10, 2013 at 12:35

2

Solved

I would like to change the colour of the tick in my WPF CheckBox from black to white. I have tried to do this in the CheckBoxdeclaration as such: <CheckBox Background="black" Foregroun...
Lettie asked 8/1, 2021 at 13:42

3

Solved

Do ControlTemplates in WPF require a TargetType? I am restyling some controls, and notice that the comboboxitem, listiviewitem and listboxitem all have the same template: <ControlTemplate x:Ke...
Brinkema asked 3/9, 2010 at 0:6

2

Solved

I working on a WPF project where I've over-ridden the CheckBox control for some special operations. That is working correctly. My problem is that the ControlTemplate that was applied from the them...
Squamosal asked 9/1, 2010 at 18:56

3

Solved

Consider this (edited-down) Style, designed for a Button whose Content is a String: <Style x:Key="Test" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <Co...
Panettone asked 27/4, 2016 at 17:33

8

Solved

How to get existing control's ControlTemplate in WPF in XAML format (visual tree)? This is to help to create new ControlTemplate with the help of existing template.
Overprint asked 13/10, 2009 at 10:3

4

Solved

is there any "best practice" way to replace a part of the default template. The current use case is a treeview. As default, the treeview has this small triangle shapes to expand and collapse. I kn...
Campground asked 8/2, 2010 at 11:23

4

I want to adapt the default WPF TreeView/TreeViewItem template, so that the entire row can be highlighted, as shown in the image: However, I've tried several templates from googling, but none of...
Ciapha asked 10/12, 2014 at 10:34

7

Solved

What is difference between a ControlTemplate and a DataTemplate in WPF?
Combustor asked 27/8, 2009 at 10:14

3

I have a ControlTemplate defined in App.xaml. Now, I need to be able to handle certain UI events. In Visual Studio's XAML editor, if I attach a handler to an event, the handler is created in App.xa...
Thymic asked 1/8, 2016 at 3:24

5

Solved

I want to make a bigger checkbox in WPF. I've discovered that I need to do a control template, one example of which is found here: http://msdn.microsoft.com/en-us/library/ms752319.aspx If I use...
Fairish asked 6/6, 2011 at 17:56

3

Solved

I am attempting to define a global button style in App.xaml, and it's mostly working as I expect. However, I just cannot figure out how to get the Foreground to work correctly. No matter what I do,...
Eritrea asked 16/3, 2011 at 18:8

4

Solved

I have a generic control which displays an editor based on the type property inside a ViewModel. Currently it's implemented using Control, ControlTemplate and DataTrigger like this - <Control x...
Bozen asked 19/1, 2012 at 12:29

1

Solved

I am getting really frustrated in trying to achieve a very trivial thing (or at least, something what I would expect should be trivial...) I have a requirement where a toggle button should be cust...
Commodious asked 7/12, 2018 at 19:47

© 2022 - 2025 — McMap. All rights reserved.