23,940 questions
1
vote
0
answers
38
views
Why is my WPF DataGrid RowDetail ignoring SelectedItem but accepts ItemsSource?
I am using a WPF DataGrid with MVVM approach. The ItemsSource of the DataGrid is bound to an ObservableCollection of something which has an Id and an ObservableCollection of strings.
I want the Id to ...
0
votes
1
answer
43
views
How to dynamically create and data-bind ComboBox in code?
In my Avalonia app using the MVVM Community Toolkit, I need to dynamically create a ComboBox from code-behind, having it data-bound to a collection of a subclass of a class that encapsulates ...
1
vote
1
answer
47
views
How to bind viewmodel collection to dynamically-created ItemsControl in code?
In my Avalonia app I have a user control (UC) that has some databound controls and a StackPanel that has controls added to it dynamically from code-behind. This UC is then dynamically added to an ...
0
votes
1
answer
100
views
Can't get PNG resource to show up in Visual Studio WPF designer
I created a simple program to replicate the issue.
I've created a custom control holding one generic string dependency property:
using System.Windows;
using System.Windows.Controls;
namespace Test
{
...
0
votes
1
answer
74
views
How to specify bound property of known name for Avalonia control created in code-behind?
In my Avalonia app, I need to create controls dynamically from a user control's code-behind so I can add them to a StackPanel inside that user control. I know the names of the viewmodel properties to ...
1
vote
1
answer
141
views
How can I resolve issue about BindingExpression in WPF c#?
I am working on a configuration editor and I was having issues binding ObservableCollection to combobox items in XAML.
My setup:
I am using Prism
I am also using MaterialDesignThemes in the project
...
1
vote
1
answer
106
views
Why in a WinUI3 app, does DataContext binding work when debugging but causes exception when deployed and run [closed]
I have a WinUI3 app that I am trying to use in an MVVM pattern.
I have a ViewModel that implements INotifyPropertyChanged. In that ViewModel I have a simple string property (TextBoxContent) that calls ...
0
votes
1
answer
103
views
VB.NET DataGridView not showing label row with EmpId and EmpName before attendance rows
What are you trying to do?
I'm building an attendance summary grid in VB.NET (Windows Forms). For each employee, I want to insert a label row before their daily attendance rows. This label row should ...
0
votes
1
answer
113
views
How do I create dynamic rows in a WPF Grid [closed]
I have a WPF app that loads a grid table through a db query. This works as expected. I want to add a tile layout, something like this. This image represents one row.
The two different views are a ...
2
votes
1
answer
77
views
How to prevent popup reopen
I have the below code:
<ToggleButton x:Name="toggleBtn" Content="Open Popup" />
<Popup x:Name="pp"
Placement="Bottom"
StaysOpen="...
1
vote
1
answer
93
views
How to add list of MenuItem controls using MVVM binding?
I'm trying to render an MRU files menu item list using MVVM and data binding. However, I'm not able to …
assign an access key
assign a mnemonic
assign a command
This is the code I'm using:
<...
2
votes
3
answers
119
views
Trouble binding data to an IDrawable
I'm trying to put together an app, but I've run into problems trying to get data into an IDrawable graph display. The app is just supposed to show a plot of random data from a float[] which is then ...
0
votes
0
answers
18
views
Setting the WPF ComboBoxItem Background Color when an ObjectDataProvider binding is used to populate ComboBox
I have a ComboBox with an ObjectDataProvider binding to an enum of colors. I have the enum descriptions displaying. I would like to have the ComboBoxItem background color match the designated color. I'...
0
votes
1
answer
137
views
User Control with binding showing in Designer but not in runtime
I have a main Window that opens a second Window. In this second Window I have many custom UserControls generated in runtime that work just fine. But a group of custom UserControls are declared in the ...
1
vote
1
answer
135
views
How to bind List item inside DataTemplate
I have a ListView that I fill with a list of items of type FooBar, which contains only one public member Foo of string. I have my own UserControl called FooBarControl, which has a member FooBar from ...