itemscontrol

Displaying customised Item in ItemsControl

我的未来我决定 提交于 2019-12-25 06:39:24
问题 I have created a (slightly) extended Checkbox that has an IsError property (basically used to change the colour of the checkbox to red when some condition is not met) as follows: public class MyCheckBox : CheckBox { public static readonly DependencyProperty IsErrorProperty = DependencyProperty.Register("IsError", typeof(bool), typeof(MyCheckBox), new UIPropertyMetadata(false)); public MyCheckBox() : base() { IsError = false; IsCorrect = false; } public bool IsError { get { return (bool

binding to dynamic resource in ItemsControl on the ItemsSource Property

南楼画角 提交于 2019-12-25 05:32:13
问题 Hey I was hoping someone could answer a couple questions for me. How am I supposed to ensure that the bound data to itemsource updates dynamically? I can't change bindingsource from staticresource to dynamic resource because the Source Property of the Object Binding is not a dependency property of a dependency object. What does binding to a staticresource mean exactly? I would think that binding to a dynamicresource would mean that the dependencyproperty updates when the resource changes.

binding to dynamic resource in ItemsControl on the ItemsSource Property

隐身守侯 提交于 2019-12-25 05:32:10
问题 Hey I was hoping someone could answer a couple questions for me. How am I supposed to ensure that the bound data to itemsource updates dynamically? I can't change bindingsource from staticresource to dynamic resource because the Source Property of the Object Binding is not a dependency property of a dependency object. What does binding to a staticresource mean exactly? I would think that binding to a dynamicresource would mean that the dependencyproperty updates when the resource changes.

WPF ItemsControl ItemTemplate border with GroupStyle

∥☆過路亽.° 提交于 2019-12-24 12:34:26
问题 This is the first time I've posted a pic, so hopefully it turns out well (a picture is worth a thousand words, and I don't want to type a thousand words). But, the image below is what I'm trying to accomplish. I have a collection of objects that I'm needing grouped by property "Group". I'm using a CollectionViewSource that is bound to my data source that is doing the grouping for me. I'm using an ItemsControl control (but could easily use another control) to display this information. I'm able

Stretch line to width of Itemstemplate canvas in itemscontrol

狂风中的少年 提交于 2019-12-24 09:36:46
问题 I have this code. For some reason I can't get the contentpresenter to stretch to fill the width of the canvas. Several of my attempts are commented out in the xaml. <ItemsControl ItemsSource="{Binding MarkerLocations, Mode=OneTime}" HorizontalContentAlignment="Stretch"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerStyle> <Style TargetType=

Can I have a Treeview without the tree structure?

扶醉桌前 提交于 2019-12-24 07:06:14
问题 Can someone tell me how I can template a treeview control so that it doesn't look like a tree? Basically, I want to remove the indents at various levels as well as the +/- that allow for expansion and collapse. The actual requirement is that I have a hierarchical data template that is bound to an object collection that is recursive in nature. And I want to display these objects on screen in a flat manner. The best solution would be to get the hierarchical data template to work with an

How to add children of an ItemsControl where the children should decide their own position in Wpf?

耗尽温柔 提交于 2019-12-24 05:57:46
问题 I am using a wpf slider to display the time line in a video player. I need to add an ItemControl of some sort on top of this so that I can add buttons on the time line on certain positions in the time line (the buttons will hold their own position relative to the parent ItemsControl). What ItemsControl container should I use where I can add child elements that know their own position (based on their timecode)? I have looked at the different ItemsControls in Wpf, and it looks like all of them

How to add children of an ItemsControl where the children should decide their own position in Wpf?

时光怂恿深爱的人放手 提交于 2019-12-24 05:57:03
问题 I am using a wpf slider to display the time line in a video player. I need to add an ItemControl of some sort on top of this so that I can add buttons on the time line on certain positions in the time line (the buttons will hold their own position relative to the parent ItemsControl). What ItemsControl container should I use where I can add child elements that know their own position (based on their timecode)? I have looked at the different ItemsControls in Wpf, and it looks like all of them

How do I build a paged ItemsControl or Panel with a repeating header?

橙三吉。 提交于 2019-12-24 05:45:14
问题 I'm trying to build a Panel or ItemsControl that will display items in the form of: Header 1 Sub Item 1 Sub item 2 Sub Item 3 Header 2 Sub Item 1 Sub item 2 This is easy enough, but the catch here is that I need to be able to split the items in a Paged fashion. Based on the height of the control, whatever does not fit will be on the next Page (and so on). If a split occurs between subitems, I need to re-display the corresponding header on the next page as well. I made some progress working

Massive performance issue with nested ItemsControl

孤者浪人 提交于 2019-12-24 02:37:06
问题 I use a nested ItemsControl to display hierarchical data. Problem is that this is terribly slow even with little data. Its also blocking the UI-Thread completely until data is loaded. What am I doing wrong here? Code to generate Demo-Data and bind it to the ItemsControl: private void SetupDemodata() { ObservableCollection<Folder> demoData = new ObservableCollection<Folder>(); const int numberOfFolders = 1; const int numberOfFiles = 1; const int numberOfLines = 300; Random randContentLength =