30,346 questions
Best practices
1
vote
5
replies
82
views
Handling mutable models in MVVM
In an MVVM architecture, models should be kept free of UI-related logic. They represent pure data that is retrieved from memory via a service. I see a challenge when the user interface needs to ...
3
votes
1
answer
49
views
Binding data to a ContentView in Syncfusion Popup (MAUI)
I'm trying to have a Syncfusion Popup in my app. Because of the size and for reusability I put the Popup's content into a separate ContentView. However this makes the Binding to the content fail. I ...
0
votes
1
answer
90
views
How to handle empty string textbox bound to an int property validation error in WPF? Value "" could be not converted MVVM
Using MvvmCommunityToolkit and maybe is irrelevant, but I'm also using MaterialDesignForXAML UI library that sets default material design style for textbox if not is declared explictly.
I have a ...
0
votes
2
answers
122
views
How to share values that are split from one property across multiple controls in WPF & C#
I have a case where say I have one property that has a string which contains a separator (e.g. ':'). I have 3 text boxes and I would like to share each separated part value in each textbox and also ...
2
votes
1
answer
158
views
How can I edit text inside Avalonia DataGrid cell and take the new text value of that cell to make a query?
I'm developing an Avalonia Application and I'm trying to figure out how can I make a DataGrid cell editable, here's my DataGrid to make it more clear:
<DataGrid IsReadOnly="False" ...
0
votes
0
answers
31
views
How to simultaneously display the conversion progress of multiple PDF files when using PDF Focus .Net?
I'm a developer currently using PDF Focus .Net in a WPF application that follows the MVVM pattern.
While working with the PdfFocus.NotifyPageProgress event and the PageProgressDelegate, I encountered ...
0
votes
1
answer
66
views
How can I compare a tree with different node types to a list of courses to see which courses have been completed and which haven't?
I'm working on a transcript analyzer personal project and I'm having an issue comparing the courses that are read in from the transcript with the required corses. The required courses are stored in a ...
-2
votes
2
answers
114
views
How to handle selection and update in MVVM?
I'm playing around with MVVM and have trouble wrapping my head around how to work with selecting a single element.
Following online examples I've written something basic that fetches a list of data ...
1
vote
1
answer
114
views
C# WPF strict MVVM: Basic TreeView SelectedItem ViewModel Problem
I’m trying to bind the SelectedItem of a WPF TreeView to a property in my MainViewModel in a pure MVVM setup (no code-behind).
Since TreeView.SelectedItem is not a dependency property, I created an ...
-2
votes
1
answer
84
views
Adding a file path to the local storage in the ViewModel MVVM NET MAUI [closed]
enter image description here
My task is to get a photo from the stream and then save it to local storage and pass the path to this photo to the ViewModel, and then save the path in the database. I put ...
0
votes
1
answer
87
views
Draw a straight line between two visual elements in MAUI app. .NET 9 [closed]
I’ve developed a cross-platform Sudoku app for Android and Windows using MAUI (.NET 9) and Shell, following the MVVM design pattern. The UI is defined in XAML using StackLayout to organize visual ...
2
votes
1
answer
105
views
Clean way to share data between viewModels
I'm trying to follow Google's clean architecture guidelines.
I have a navigation subgraph with multiple pages corresponding to stages of filling a form.
Each page has it's own viewModel.
On the last ...
1
vote
0
answers
149
views
C# Winforms Datagridview with BindingSource is not filled at startup
I write a C# winforms application using the MVVM pattern. Data is stored in EF Core.
The objective is to show datasets of an EF core entity in a datagridview object.
The problem is that the ...
1
vote
2
answers
93
views
Is there a way to intercept the return key on a MAUI editor?
I'm trying to develop a chat application and I'm looking for a way to have my maui Editor accepts the return key pressed as a send command.
Certainly the Editor doesn't have an AcceptsReturn property ...
0
votes
1
answer
64
views
WPF - If P has-a Q, and they are ViewModels, and the view has a template P' which contains another template Q', how can I bind something in P to Q'?
I'm using Prism/MVVM/WPF and have ViewModels:
public class ViewModelP : BindableBase
{
private string _stringP;
public string StringP
{
get => _stringP;
set => ...
0
votes
1
answer
162
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
1
answer
84
views
WPF MVVM use dependency property in its own UserControl xaml
I have a UserControl with a dependency property and its own ViewModel.
In xaml
<control:SelectInDataBaseControl DataContext="{Binding Property}" ForegroundColor="Both" />
...
0
votes
1
answer
108
views
DependencyProperty as Setter for Style Trigger [closed]
Context
I made a custom control called ButtonPath which is derived from the default Button to allow me to easily add Buttons with different PathGeometry Figures and SolidColorBrush from the ...
0
votes
1
answer
50
views
How do I access a slider value from content page in ObservableObject view model
I have a slider on my Content Page and I want to access the value of it from an ObservableCollection (used in the content page) to check the time value I need to compare with. Below is the function I ...
0
votes
0
answers
56
views
Maui Tap Gesture not firing
I have a label in a collection view with a tap gesture which is not firing. Below is the XAML with the tap gestures in the label (I have tried both methods is swipe and tap but they don't fire). I ...
-2
votes
2
answers
61
views
Filtered data not updating until manually refreshed
I have a collectionviewsource with filtering applied. I want the filter to be applied every time the property being filtered on changes. I believe that I have implemented property change notifications,...
0
votes
1
answer
97
views
Visibility of a datagrid is not changing when I update a static property [duplicate]
I have a datagrid, and its visibility is bound to a static property. When I update this property from the code behind file, the visibility of the datagrid does not change. Is there a better way of ...
0
votes
1
answer
82
views
My MVVM Databindings not propagating through to the view model
I am trying to learn MVVM and do my data bindings from XAML rather than the code behind. When I attempt to change the text in the textbox, the setter is never called and I cannot figure out why. Is ...
0
votes
1
answer
64
views
I need a picker in .NET MAUI to initialize to the current value of a term
I have a page that displays a list of terms. Each term has a status. See models:
public class Term : INotifyPropertyChanged
{
[PrimaryKey, AutoIncrement]
public int Term_ID { get; set; }
...
0
votes
0
answers
80
views
Problem with propagation validation errors to user control from parent window
I'm trying to learn WPF and MVVM pattern. But I'm hopeless how validation and passing validation errors work in WPF. I tried a Copilot to help with the problem, but it is stuck in circle with ideas. ...