1,204
questions
0
votes
1
answer
55
views
Binding DrawingImage to custom UserControl in ItemsControl
First time asking here, feeling desperate.
I want to bind DrawingImage (as is) to corresponding property of custom UserControl, that is created by ItemsControl. This is not an WPF Application, but ...
0
votes
0
answers
87
views
Get ItemsControl Items collection as collection of visual elements
I'm developing a graphics library.
The principle is quite simple, all chart types inherit from a BaseChart class, which inherits from ItemsControl. This BaseChart offers a Render() method and requires ...
0
votes
1
answer
55
views
Overlay multiple ImageSources automatically in WinUI / WPF using Itemsrepeater/ItemsControl
I have created several Bitmaps with a transparent background to display data. The data loads correctly, but I'm having trouble overlaying these images. I need help adjusting the layout of an ...
0
votes
1
answer
46
views
how to change Canvas.left of items in a ItemsControl?
I want to wrap some Rectangles on a Canvas.The details of rectangles are in a list in my viewmodel.I succeeded drawing the rectangles,but failed to make them movable.In my eventhandler Canvas.GetLeft()...
0
votes
1
answer
84
views
WinUI 3 - Programmatic Scroll to Virtualized Item in ItemsControl (not ListView)
I'm making a custom ItemsControl subclass with a fairly typical template:
<Style TargetType="local:MyControl">
<Setter Property="ItemsPanel">
<Setter....
-2
votes
2
answers
80
views
WPF. How to wrap two ItemsControl´s using same row?
Abstracting, I have two (main) ItemsControl's that draw their content in a wrapping way.
I use WrapPanel etc.
This works well so far. Also in case the window size is changed during runtime.
But I ...
0
votes
1
answer
64
views
Is there something can stretch to fill all remaining space when using ItemsControl
I made a simple custom control to contain some parameter, and put all of these controls in a ItemsControl like this.
I have tried all my mind to stretch the items for filling all remaining space, but ...
1
vote
1
answer
93
views
DataTemplate inside ListView (with VirtualizingStackPanel) causing StackOverflow
I have a data type, Metadata, that contains a file path to either a video or an image. I'm attempting to use a DataTemplate to display that data type. There's going to be thousands of these objects, ...
0
votes
1
answer
40
views
WPF - Create ImageGrid with ItemsControl?
sorry to bug you with a beginner question. I am trying to achieve an Image Grid (like in a comic viewer or a movie database) with WPF in C#.
Now I tried to use ListView and ListBox initially but I did ...
0
votes
2
answers
99
views
Pass a property from an ItemsControl source class into a converter parameter
I have an ItemsControl like this
<ItemsControl Name="itemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ToggleButton Style="{...
0
votes
1
answer
75
views
User control inside ItemsControl doesn't populate with mocked properties
I'm making a demo app where a simple class Fruit with two properties Name and Color is displayed in a FruitUC with a field for each. In a ProduceVM class I fill an ObservableCollection ...
0
votes
2
answers
114
views
ItemsControl that contains bound ComboBox in ItemTemplate (WPF MVVM with Caliburn.Micro)
I'm stuck with a problem to select one item in a single combo box from a list of combo boxes bound in a ItemTemplate. When I select a value in one, that value gets updated in all of them. It resembles ...
2
votes
1
answer
91
views
Why all TextBoxes in ItemsControl use the last dynamically-added ValidationRule?
I have a custom TextBox that adds MinMaxValidationRule when both Min and Max properties are set
public class TextBox2 : TextBox
{
public static readonly DependencyProperty MinProperty = ...
0
votes
1
answer
62
views
WPF. Duplicat ValidationRule for collection items
I have ObservableCollection and ItemsControl
public ObservableCollection<SomeData> Datas { get; }
I`am trying to validate a duplicate exists.
<ItemsControl ItemsSource="{Binding Datas}...
-1
votes
1
answer
101
views
Edit the canvas.Top and Left in itemsControlTemplate wpf
So I'm using mvvm to bind some elements in an item control witch has a canvas in the ItemsPanel. I want to change Canvas.Top and Left of the elements inside itemsControl when ever it's clicked.
xaml ...
-2
votes
1
answer
58
views
"Canvas" methods doesn't work in itemsControl
Canvas methods always work when they are in a canvas tag, but When you tryna use them in an itemsControl, they sometimes stop working. here's an example:
<ItemsControl>
<ItemsControl....
0
votes
0
answers
46
views
WPF filter Items Observable Collection without deleting views
I've an ItemsControl and I'm binding the ItemsSource to an Observable Collection of ViewModels. This is how I'm binding to it...
<ItemsControl Grid.Row="1" ItemsSource="{Binding ...
0
votes
0
answers
40
views
WPF Application : Textbox text selection like we do in browsers
My Application structure is attached in pictureRequiremnent
requirement 1: draw a rectagle to show area covered by mouse . here yellow rectangle
requirement 2: copy text under the yellow rectangle to ...
0
votes
0
answers
72
views
ItemsControl: get SelectionChanged on a DataGrid (MVVM pattern)
I have an item control that will populate datagrid with data from an ObservableCollection TrayTypesDataGrids
private ObservableCollection<ObservableCollection<TrayType>> trayTypesDataGrids;...
0
votes
3
answers
70
views
How to refer to the Label element in the ItemsControl to read data from it?
I need to read the id from the label and write it to a global variable to render the content on a separate page. But since this label is generated by ItemControls, I don't know how to refer to it. How ...
0
votes
0
answers
12
views
Updating DataContext of UserControl in ItemsControl at runtime doesn't work [duplicate]
I am trying to update the state of LED UserControls after loading them into an ItemsControl, but I notice that an initial PropertyChanged event is triggered on the UserControl property while ...
-1
votes
1
answer
37
views
Some Properties are not binding when used in ItemsControl
I have an ItemsControl element that populates a Stackpanel. Its bound to a ObservableCollections full of "LedModel" objects (see below).
I cannot get the binding for Brush, Size and ...
0
votes
1
answer
366
views
WPF Drawing a list of rectangles in a collection
My WPF app has a ViewModel that has an ObservableCollection that holds objects of type Item. Each Item has a color and a Rect that is drawn on the canvas:
Item Class:
public class Item
{
public ...
0
votes
0
answers
38
views
ItemsControl DİsplayMemberPath property does not work
In the following code, the variable named attributes is defined as a collection of SchemaAttribute objects, in which each object has a "Name" property and bunch of other properties. I create ...
0
votes
1
answer
70
views
How can I display my ItemsControl with List<Line> in view when the DataContext is a design instance?
I’m having trouble displaying lines (System.Windows.Shapes) in my view. I have a “magnifying glass” view with a hardcoded x- and y-axis in the middle, and I’m supposed to add “scale bars” to the axes (...
0
votes
1
answer
230
views
WPF Nested ItemsControl with custom Panel & ItemContainer
I am creating a rudimentary Gantt chart as a visual representation of a schedule of events. To do this, I have an ItemsControl to render schedule line items in a StackPanel. Within that "parent&...
-1
votes
1
answer
73
views
ItemTemplate for UserControls in ItemsControl - WPF
My task is to implement a MDI-like interface in our WPF app.
I have created this simple class as a base for all the views:
public class BaseView : UserControl, INotifyPropertyChanged
{
public ...
0
votes
1
answer
49
views
Using UserControl with custom properties in ItemsControl
I want to use a custom UserControl in an ItemsControl but it is not working.
A minimalistic example:
Project.Controls.UserControl1.xaml
<UserControl x:Class="Project.Controls.UserControl1&...
0
votes
0
answers
200
views
WPF C# - Set focus to the last item of ItemsControl
In my WPF application, I have an items control, which includes text boxes and I also have a button which adds a new item to the items control.
And I want that the focus will be set to the new item.
I ...
0
votes
0
answers
44
views
WPF negative Margin working different than expected (in ItemsControl)
I'm trying to make a calendar view in WPF, because the basic <Calendar /> control isn't flexible enough, as I need a day-view to display meetings for that day. So I thought to myself, that I ...
1
vote
3
answers
234
views
MVVM How to pass object in Itemscontrol
Is there any way to bind whole object while generating list by itemscontrol?
MainWindowViewModel.cs
private List<TrackModel> _trackModels=new List<TrackModel>();
public List<...
0
votes
2
answers
585
views
How to sort ItemsSource dynamically in C#; WPF
I use in XAML an ItemsControl where and in its ItemsSource I make a Binding for an Enum, thus creating a list of RadRadioButton dynamically, and if someday another item is added to this enumerator my ...
0
votes
1
answer
72
views
Displaying collection of objects with ItemsControl
I am trying to display collection of objects using ItemsControl. This is the simple example I created;
<Window x:Class="PhotoWieverWPF.MainWindow"
xmlns="http://schemas....
-1
votes
1
answer
62
views
Combobox data binding inside ItemsControl
I have combobox inside a ItemsControl. How to bind the selected value of the combobox to the ItemsControl items with object not with int value. When i change the combobox everything is working well ...
0
votes
1
answer
654
views
Is there a way to inject an Item/DataTemplate into a custom Style or UserControl?
Read update for a solution
I have a small WPF Application with several small game clones such as Minesweeper, Connect 4, Tic Tac Toe among others.
Common for all of these is that they are all a ...
0
votes
3
answers
330
views
How to access Canvas instance when it is in ItemsPanel?
I have changed my view from simple Canvas to ItemsControl that uses Canvas, because I want to bind Canvas children to my ViewModel.
It was like this:
<Canvas x:Name="worksheetCanvas"> ...
0
votes
1
answer
43
views
Filter Control with Select all
I created the following control:
public ObservableCollection<User> Users { get; set; } = new();
<CollectionViewSource
x:Key="UsersKey"
IsLiveFilteringRequested="True&...
-1
votes
1
answer
152
views
How to use alternationindex on code behind wpf
I have Itemcontrol in WPF. And Items source using Binding property.Items are only one button
How can I show index of item when I clicked Button? I read about AlternationIndex but only show on the xaml ...
0
votes
1
answer
145
views
How to put three dots at the end of the StackPanel that will say there are more items
I would like a behavior like in TextBlock that can be given TextTrimming="CharacterEllipsis" and then I will get three dots.
<ItemsControl ItemsSource="{Binding MyList}" ...
0
votes
1
answer
186
views
ItemsControl with 2D Array and huge data amount
i have a rather specific problem which i am trying to solve using WPF and C#.
When i try to present hierarchical 2D Data to my UI it works fine for small amount of data but starts lagging as crazy, ...
2
votes
1
answer
174
views
How to Apply .nextElementSibling to the next item of a dropdown menu
I have a menu that contains sub-items, when I click on them it pops up showing the items. I managed to open the first item, but I can't do the same with the second. I'm trying to use ....
0
votes
1
answer
95
views
Canvas with static content and items
I have a Canvas which contains static elements - those elements use binding to draw it in the right places. Now I need to draw other elements depending on items in a collection. I want to use ...
-1
votes
2
answers
1k
views
WPF How to find a specific control in an ItemsControl with data binding
I have an ItemsControl which is bound to a list:
<ItemsControl x:Name="icFiles" ItemsSource="{Binding Path=files}">
<ItemsControl.ItemTemplate>
<...
0
votes
1
answer
163
views
WPF: How to generate screenshots of items within a ItemsControl (within a TabView)
I have a TabControl where each tab is a user control that has an ItemsControl in it.
The TabControl is bound to a collection and has an ItemTemplate:
<DataTemplate x:Key="tabContentTemplate&...
0
votes
1
answer
536
views
How to bind to a collection inside of a collection?
I'm trying to bind an itemscontrol to a collection inside of another collection. To do this, I've layered an itemscontrol inside of another itemscontrol, like so:
<ItemsControl ItemsSource="{...
1
vote
1
answer
719
views
ComboBox binding inside Item template with IEnumerable collection
I have one class MovieSystem which inherits from AvailableMovies collection.
public class MovieSystem : IEnumerable<AvailableMovies >, IEnumerable
{
public AvailableMovies this[int i] { get;...
0
votes
1
answer
104
views
WPF how do I change the binding of a ContextMenu inside an itemControl
My goal is to disable/collapse a menuitem if the user does not have the rights to it.
The binding i'm looking for is in my ViewModel as a boolean. I know that it's trying to find the property "...
-1
votes
1
answer
35
views
How to replicate behavior of standard list elements to instantiate child items in WPF?
I'm creating a Wizard control based on Selector. My plan is that it will behave in the similar way to TabControl, ListBox, etc. - by having its own child items.
What I already did is:
public class ...
0
votes
1
answer
519
views
How to bind a MultiDataTrigger with bindings using different data contexts
I have a custom user control which is in the main window of my WPF application. Within the window is an ItemsControl. I have created a style so that I can bind to an array of items which is a property ...
1
vote
1
answer
594
views
How to call Items.Refresh()?
I am making a filter for a collection.
I know how to do it using CollectionViewSource.
But I wanted to do it without using CVS.
According to my ideas, there is a CollectionView in the ItemsControl....