itemscontrol

TwoWay Binding With ItemsControl

I'm trying to write a user control that has an ItemsControl, the ItemsTemplate of which contains a TextBox that will allow for TwoWay binding. However, I must be making a mistake somewhere in my code, because the binding only appears to work as if Mode=OneWay. This is a pretty simplified excerpt from my project, but it still contains t...

WPF : Multiple views, one DataContext

Hi, I'm working on a WPF application which must handle multiple screens (two at this this time). One view can be opened on several screens and user actions must be reflected consistently on all screens. To achieve this, for a given type of view, a single DataContext is instantiated. Then, when a view is displayed on a screen, the uniq...

WPF Datatemplate + ItemsControl each item uses > 1 MB Memory?

Does that sound right to anyone???? I have an ItemsControl that displays data from a custom object that implements iNotifyPropertyChanged. The DataTemplate consists of: Border 3 buttons 5 textboxes An ellipse A Bindable RichTextBox (custom class that inherits from RichTextBox... so I could make Document a dependency property (to suppo...

Silverlight ItemsControl - change ItemTemplate

I have an ItemsControl with a list of radio buttons - in this case the ItemTemplate will contain a binded radio button. The problem is that in some cases I need to replace the radio button with a check box without using any C# code. Is this possible? I thought at using a ValueConverter (C# code) but I don't know for sure if will work. ...

WPF: Buidling my own paging itemlist....;)?

Hello, for reasons based on storabiligty I have the following objects in a XAML graph: A WorkArea, Containing WorkSheets, Containing WorkItems WorkArea, workSheets are ItemsControl instances. To start: The reason that I am not using standard elements here is that mine are going to get loaded / saved - they represent a business cont...

How can I design a curve editor that works well with the WPF model?

I have a data model that represents segments of a curve that looks like this: The fields are x and y coordinates of the anchor points (red), and a slope value represented by the control points (green). For the curve to be editable by the user, I'm thinking of using Thumb objects for both anchor and control points. Since I also would ...

What's the easiest way to sort an EF4 EntityCollection<T>?

I'd love to add some sorting to an EntityCollection that is bound to an ItemsControl (in xaml). I'd also like to do it as simply as possible. It appears that this is not possible. If I wrap the collection in a "sorted" version of the collection property within the Entity I lose collection change notifications. I can't use a Collectio...

What exactly does Panel.IsItemsHost do?

I cannot find any good documentation for the Panel.IstItemsHost attached property. I see plenty of examples of people setting it on the ItemsContainer template for an ItemsControl, but the un-documentation over at MSDN does not explain why or what advantages setting property confers. I have built plenty of containers that do NOT set th...

Possible to implement an IsViewPortVisible dependencyproperty for an item in an ItemsControl?

I need to enable/disable spell checking in a richtextbox in an ItemsControl, based on whether the RichTextBox is visible in the ItemsControl's Scrollviewer. I think the route is to implement an IsViewPortVisible dependency property and wire an event handler for a changed event... I found this article that describes the lengthy process ...

How to obtain the panel within a treeview (WPF)

How can one obtain the panel that is used within a TreeView? I've read that by default TreeView uses a VirtualizingStackPanel for this. When I look at a TreeView template, all I see is <ItemsPresenter />, which seems to hide the details of what panel is used. Possible solutions: 1) On the treeview instance ("tv"), from code, do this:...

WPF Spellcheck Engine takes up too much memory.

Each datatemplate in my WPF ItemsControl contains FIVE custom bindable richtextbox controls. It is a data-driven app that for authoring multiple-choice questions --> The question and four answer choices must all support: 1) Spell check 2) Rich formatting (otherwise I'd use regular textboxes) The spell check object in .NET 4 has a Frie...

WPF Delay Refresh of UI Elements in ItemsControl

Hello All, The short question is - how can I prevent (delay) a bound UI element from refreshing until I want it to? The longer explanation: I have a process that adds a number of items to an ItemsControl, and then performs some additional calculations on those items using a background thread. This (correctly) updates the items as it g...

Adding a selection box into an ItemsControl?

I have a WPF ItemsControl with a Canvas ItemPanel. Drawing from an internal source, it displays lots of automatically generated Rectangles. As of now, it looks like this: <Window // .. NameSpaces > <Window.Resources> <DataTemplate x:Key="binTemplate"> <Rectangle x:Name="Rect" VerticalAlignment="Bottom" ...

WPF Dynamic Layout with ItemsControl and Grid

I am creating a WPF form. One of the requirements is that it have a sector-based layout so that a control can be explicitly placed in one of the sectors/cells. I have created a tic-tac-toe example below to convey my problem: There are two types and one base type: public class XMoveViewModel : MoveViewModel { } public class OMoveViewMo...

What am I doing wrong with my ItemsControl & databinding?

I'm reworking my simple hex editor to practice using what I've recently learned about data binding in WPF. I'm not sure what I'm doing wrong here. As I understand it, for each byte in the collection "backend" (inherits from ObservableCollection), my ItemsControl should apply the DataTemplate under resources. This template is just a text...

Silverlight ItemsControl with Alternating ItemTemplate

Silverlight does not support Alternating Item Templates in an ItemsControl. I have a few ideas in mind as to how to accomplish this, but to avoid polluting the potential answers, I'll leave them out. The idea is the same as a normal ItemTemplate in that it won't depend on anything in the bound data context to function. I would like th...

Irregular layout ItemsControl

I have a strange layout for an ItemsControl. I have a 4x6 grid with the following pattern: 1 2 3 4 13 14 15 16 5 6 7 8 17 18 19 20 9 10 11 12 21 22 23 24 Is there an easy way to do this? should I be using 6 Items Controls and take "sections" of my list? is there a good way to do this? What about notification? It's importan...

ItemsControl ItemTemplate Binding

Hi All, In WPF4.0, I have a class that contains other class types as properties (combining multiple data types for display). Something like: public partial class Owner { public string OwnerName { get; set; } public int OwnerId { get; set; } } partial class ForDisplay { public Owner OwnerData { get; set; } publi...

Animating an ItemsControl in WPF: sliding and fading

I would like to animate when items are added/removed from an ItemsControl. Does anyone have ideas/links on how to achieve this? I think fading-in should be doable by attaching an animation to the Loaded event. Fading out seems it would be much harder, though. As for sliding, when an item disappears, I want the rest of the items to slid...

WPF customized ItemsControl and Binding

Hi, I have created a custom ItemsControl called Toolbox. I want to be able to display images in that Toolbox - it is a part of a diagram designer. My xaml looks like this: <d:Toolbox ItemsSource="{Binding}"> <ItemsControl.ItemTemplate> <DataTemplate> ...