23,925 questions
0
votes
2
answers
100
views
TreeView HierarchicalDataTemplate ItemsSource binding to self without a property path
I have a custom model class that implements IList, IList<TItem>, ICollection, ICollection<TItem>, IEnumerable<TItem>, and IEnumerable, that I want to use as DataType under ...
0
votes
1
answer
112
views
How to bind the property change in my window when the change happens in another class?
I want the property UserBalance to change in the window, but the change happens in another class.
This is my bankaccount.cs where I have the balance and it changes through methods like deposit and so ...
0
votes
0
answers
63
views
Is it possible to bind ItemsControl to a nested property
I am working on an application that helps to manage Gym progress. In my app an user creates a profile and is able to create sets of exercises. I have 2 classes that are important in my question. The ...
Best practices
0
votes
4
replies
65
views
Excel VSTO List Object Binding with User Formulas
I have an Excel VSTO AddIn (C#) that binds a ListObject (Microsoft.Office.Tools.Excel) to a DataTable (System.Data) using the ListObject.SetDataBinding( DataTable, "", string[]) method. ...
0
votes
0
answers
96
views
How do you set up binding in MAUI using MVVM with a CheckBox, CollectionView, DataTemplate and EventToCommandBehavior?
I am running into an issue trying to call a method in my ViewModel by using EventToCommand. When I use binding in the CommandParameter with a string, the method is called buy the passed parameter is ...
0
votes
1
answer
90
views
What is the VB.NET winform equivalent of C#'s Binding.DoNothing?
In a win-form application, I have two radio buttons called "optVal1" and "optVal2", where optVal1 is checked by default. I use the following two lines to add data binding to a &...
Best practices
0
votes
2
replies
164
views
MVVM best practice for data bindings and community toolkit
I’m building a WPF application using the MVVM pattern and the CommunityToolkit.Mvvm (MVVM Toolkit). I’m trying to understand the correct way to combine RelayCommand, data binding, and DataTriggers in ...
1
vote
1
answer
69
views
Why can't the compiler find my Binding Adapter?
I was working on an XML + DataBinding Android project, but builds were failing with errors.
I have reproduced the problem in the following simple sample:
activity_main.xml
<?xml version="1.0&...
2
votes
2
answers
120
views
WPF ListView items not displaying data from Binding (showing blank or wrong values)"
<ListView Grid.Column="2" Margin="10 10 10 10"
ItemsSource="{MyPeople}"
SelectedItem="{Binding ChosenPerson}">
<ListView....
1
vote
0
answers
155
views
Bind/sync DataGridView.Rows with List
I have created a class inheriting the DataGridViewRow class. We'll call it CustomRowClass.
I have custom rows stored in a List<CustomRowClass> customRows.
Is there a way to bind a DataGridView's ...
Best practices
0
votes
1
replies
95
views
Design pattern for keeping two mutable object views in sync
I have been working on a game engine and have come upon a design that is challenging for me to implement. In particular, I need two mutable objects, that themselves contain mutable properties, to ...
1
vote
2
answers
176
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
77
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
99
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
118
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
154
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
222
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
145
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
125
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
132
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
81
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
97
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:
<...
3
votes
3
answers
153
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 ...
1
vote
2
answers
74
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
156
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
146
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 ...
0
votes
0
answers
54
views
Angular - how to display the selected's label of dropdown on the md-table when data is bind
The md-table is bind to data assets where application_id is an integer.
The dropdown is populated with possible values with:
Value = application_id, Label = application_name
The table is editable ...
0
votes
0
answers
32
views
How to handle a generic type param being changed when pattern matching is required for the child fragments that do the editing
I have the following Blazor component:
@using System.Linq.Expressions
@typeparam T
@switch(Value)
{
case bool boolValue:
<InputCheckbox @bind-Value=boolValue @bind-Value:after=...
0
votes
1
answer
213
views
Property not updating view when getting changed from another VM
I am using Avalonia with CommunityToolkit MVVM. When I change the Property (integer) within the original VM, where it is defined, it does update the view. When I change the Property from a child class,...
0
votes
0
answers
40
views
See Changes on Models Properties in View to View Data Binding Using .NET MAUI
I have two .NET MAUI Content Views binding a model from parent view named IdentifyCntrl to child View named ChildControl. I'm binding a model named IdentHeightModel from ParentControl to ChildControl. ...
0
votes
2
answers
81
views
What is the way to dynamically bind a language resource to a text property in WPF?
I know about DynamicResource and it works well. But in my program I have a TreeView and several DataTemplates (for categories and for items). And the element has its own name key(of resource). So ...
0
votes
1
answer
205
views
What interfaces should be implemented for property change notification in Winforms 4.0?
I have a decent background with WPF and more modern databinding scenarios, but I am working with a project that targets .NET Framework 4.8 utilizing Windows Forms 4.0.
I have been using ...
1
vote
0
answers
34
views
Blazor form model binding fails on nested route like "/System/Authentication/login" but works on simple route "/login"
I'm using Blazor Server and have this page directive:
@page "/login"
My form model binds correctly here. But when I change it to:
@page "/System/Authentication/login"
the model ...
1
vote
1
answer
74
views
ngModel gives error on build project in Angular
I am using angular 19 and getting error in building project. My app.component.html is
<div>
<div className="navbar">
<nav >
<ul>Todo App</ul>
&...
0
votes
2
answers
161
views
Leaflet.js Tooltip Rendering Issue When Binding Dynamic Data to Station Markers in Loop
I'm working on a route visualization tool using Leaflet.js to map Amtrak train routes. I'm loading station coordinates from a JSON array and creating markers with custom tooltips showing station names,...
0
votes
0
answers
66
views
Problem binding an inner user control property to an outer user control property [duplicate]
I am placing a user control inside a user control and I am having trouble binding the inner dependency property to an outer dependency property. I am using .NET 8. It is probably something stupid ...
1
vote
2
answers
169
views
Programmatically bind values to a CollectionView in .net Maui
I am trying to create a simple CollectionView in Maui programmatically. The ItemSource is just a list of int.
var intValues = new List<int>() { 1, 2, 3, 4, 5, 6 };
var pointsCV = new ...
1
vote
2
answers
73
views
.NET MAUI - XAML : How can a view have additionnal controls according to the object binded?
I am trying to custom a view with the object binded on it.
This view is a preview of a taken photo. The photo can be an uploaded photo (already upload on the server) or an offline photo (if the ...
-1
votes
1
answer
73
views
Pass current element of ItemsControl to viewmodel of child UserControl
I have a component Parent with the ViewModel ParentViewModel, which contains
public ObservableCollection<string> FileNames { get; set; } = new();
I want to pass the current element of this ...
0
votes
1
answer
123
views
WPF C# Data bindings on custom controls
I want to create a custom control that will act as a draggable control (drag and drop), and use it in a window.
my problem is that I cant get the binding to work.
Data context is being set in window....
0
votes
1
answer
59
views
Binding input in a child component in Blazor WASM app
I'm working on my version of an auto complete component in a Blazor WASM (Standalone) app targeting .NET 9.
I'm able to bind an input to a string variable and take action as user types in his/her ...
0
votes
1
answer
80
views
Why does my radio button binding not work properly?
I have trouble with the binding of radio buttons in Blazor. I created a blazor fiddle. Please test the following:
Open the fiddle.
Click some radio buttons and see that the text input is updated ...
-2
votes
2
answers
63
views
Angular [] in view and @Input in component [closed]
In most angular tutorial, property binding [] is display value from component to view (Property binding moves a value in one direction, from a component's property into a target element property.)
...
0
votes
1
answer
49
views
Angular, [(ngModel)]="abc", unknown how the part (ngModel)="abc" works
In Angular, [(ngModel)]="abc", I know this mean two way binding, change value abc in model (ts) will reflect in view (html), change the view value will update the value in model, as tested ...
0
votes
1
answer
427
views
Blazor/Razor page @bind-Value does not bind
[Edit] Solution thanks to @GH DevOps
Make sure you are using rendermode InteractiveServer and use standard HTML tag for instead of
So I'm trying to bind a text input to a model generated by EF using ...
1
vote
1
answer
111
views
Trying to make a tooltip's visibility change based on its text (hide if empty) and a boolean [duplicate]
This has been marked as a duplicate of this question, which solves a different problem and does not mention anywhere how to solve the Binding problems I had. They were trying to bind ToolTip to ...
0
votes
1
answer
214
views
How to bind in WinUI 3 nested template binding to the view model?
I have a winui3 app that has responsive UI for screen like desktop, tablet and mobile. I have three template for that. and I used content Control inside the page within the Content Control there is ...
0
votes
1
answer
140
views
Does BindingList<T> benefit from BindingSource or INotifyPropertyChanged?
I have a WinForms form that defines a BindingList<Item>. And this list is assigned to the DataSource property of a ListBox.
This works pretty well. Any changes made to the list are also ...
0
votes
2
answers
684
views
In .NET MAUI with MVVM, How do you implement a SwipeView in a CollectionView
I have been at this for several days. Please show me my dumb error.
I have even dumbed down my code to just about match the example in this article with no luck.
(https://learn.microsoft.com/en-us/...
1
vote
1
answer
115
views
C# WPF Create Context Menu for DataGrid Cells
I'm trying to display a context menu on individual cells of a DataGrid. When the user right-clicks the cell, I want a context menu showing 'copy to clipboard' to appear, and upon clicking it, it ...