Questions tagged [contentpresenter]
The contentpresenter tag has no usage guidance, but it has a tag wiki.
contentpresenter
222
questions
0
votes
1
answer
28
views
WPF - ContentPresenter not working for tooltip in template
I'm trying to create a ControlTemplate for a simple help icon that displays a ToolTip given by the content of the control using the template.
This is a working template with a static text, if I use a ...
0
votes
1
answer
170
views
WPF ContentPresenter content not inheriting DataContext
I'm refactoring some code at the moment, and am attempting to make a custom 'TabControl'. Ideally I would just style the built-in one but there's some quirks to our codebase and I have to keep the ...
0
votes
2
answers
618
views
.net MAUI DataTemplate with a CollectionView that contains <ContentPresenter /> in its ItemTemplate, "No installed components were detected"
We have a number of Views that display a list of Models and in each of those views, tapping on an Item displays an action sheet.
Everything is working well but we want to utilize the ControlTemplate ...
0
votes
1
answer
54
views
WPF Multiple ContentPresenters same content - Only 1 is populated
Here's an extremely basic example of what I'm trying to do but does not work:
<StackPanel>
<StackPanel.Resources>
<Grid x:Key="MyYellowEllipse">
<...
0
votes
1
answer
423
views
How to change the color of Text of ContentPresenter in .Net MAUI
I have using custom styled Radio Button in my application where it uses ContentPresenter for displaying text/content. I want to change the color of the Text.
I have tried TextColor and TextBlock....
0
votes
0
answers
43
views
in wpf Treeview, How I can combine multiple Items as childes into one grouped Item in Lower Level of treeview not upper level?
I need to affect the TreeviewItem Class or make inherited Class, so that I can Implement grouping for multi childes as ItemsPresenter into one grouped item like the following figure:
Probably, Adding ...
0
votes
0
answers
66
views
WPF ContentPresenter Recreating Template
I have strange behavior with the ContentPresenter in WPF. I use the ContentPresenter control in my user control to change some child controls based on a property change in my view model. The ...
1
vote
1
answer
97
views
UWP - drag and drop with CanReorderItems= "true" in Gridview, app will crash that exception's message is "The parameter is incorrect"
I implemented drag and drop on GridView and used "Canreorder" property to change item's position.
I encounter a crash if use a "ContentPresenter" on GridView when is dragging and ...
0
votes
2
answers
75
views
ContentPresenter's "Content" not centrally aligned vertically in UWP Controls
I am using a ToggleSwitch control to display 2 exclusive options in the application. Unfortunately, when FontSize increases the "Content" part seems to be not centrally aligned vertically.
...
0
votes
1
answer
91
views
XamarinForms ContentPresenter not passing viewmodel data to contentpage being displayed
As one of a few different methods for displaying ads on a page, I tried creating a ContentPage that gets instantiated as the parent class for another page.
Here is how the parent page is created ...
0
votes
1
answer
614
views
ContentPresenter with ContentTemplateSelector inside an ItemTempate of an ItemsControl
So, I have an ItemsControl with an ItemTemplate to visualize the items in it's ItemsSource.
This Template is a DataTemplate with some controls in it.
<ItemsControl ItemsSource="{Binding ...
0
votes
1
answer
545
views
DataGridTemplateColumn.CellTemplate is not working when ContentPresenter.ContentTemplate DataTemplate is modified
I do have following style:
<Style x:Key="DefaultDataGridCell" TargetType="DataGridCell">
<Setter Property="FontSize" Value="13"/>
<...
0
votes
2
answers
298
views
ContentPresenter from ItemsControl returns null
I want to get all the UI-items from an ItemsControl.
From this post
How do I access the children of an ItemsControl?
I copied an answer and it works so far.
However, if I DIRECTLY execute the code in ...
0
votes
2
answers
54
views
Issue to preserve binding while styling a checkbox with a template
I've an issue while styling a CheckBox. I was inspired by the original CheckBox style.
The problem is, I can't find a way to apply the original binding (into the property IsSelected). When I remove ...
1
vote
1
answer
215
views
Why ContentPresenter's render time is bigger than its children's sum?
See the below picture:
I just used Performance Profiler in VS2017 and i found that the listBoxItem's ContentPresenter render time is so bigger than its children's.
I have to reduce total render time (...