169,941 questions
0
votes
0
answers
131
views
Scrollviewer.ComputedVerticalScrollBarVisibility doesn't change in a loop [closed]
I have a user control made of white border, a ScrollViewer and a RichTextBox in it, which supposed to display a footnote text when the mouse is over the footnote special sign in the text.
<Grid>
...
-2
votes
1
answer
149
views
WPF (.NET 8) XAML cannot resolve namespaces, converters, ViewModels despite classes being public
I'm losing my mind over this project and honestly have no idea what else to try.
I'm working on a WPF app targeting .NET 8 and I'm getting a massive number of XAML errors like:
XDG0008: The name &...
0
votes
2
answers
98
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 ...
1
vote
1
answer
70
views
Does ValidationRule.Validate(object, CultureInfo, BindingExpressionBase) get called automatically if overridden?
I have a custom WPF ValidationRule and I want the validation range to depend on another value in the view model.
I used to use this two-argument override:
public override ValidationResult Validate(...
0
votes
0
answers
79
views
How to stretch the datagrid columns to fill whole datagrid and not have an empty column?
I am trying to modify the datagrid columns so that they get build and stretch the column sizes. The code are the following:
<ScrollViewer x:Name="MainSubGrid" ...
0
votes
2
answers
93
views
How to change the DPI awareness setting of my .NET 4.8 WPF application?
Of course I already googled that. So I added the app.manifest with the <dpiAwareness> tag to the project and referenced it in the project file. This tag is also found in the compile output ...
1
vote
1
answer
98
views
How to have a debug window that shows geometry and is fully responsive?
I have a project that manipulates geometry, and although I can step through the code and see the values, it's quite hard to verify everything without looking at the geometries that are being used/...
0
votes
1
answer
107
views
How to edit items inside an observable collection from a view [duplicate]
In my application I am displaying items from an observable collection and I want the user to be able to edit them. Lots of threads here discuss how to add or remove items from a collection, but I ...
0
votes
2
answers
104
views
How can I simplify data triggers for null values in a DataGridTextColumn in WPF
As you can see in this example, I need to repeat the binding for each column in its trigger. Is there a way to make this generic so that I can just set the style once instead of having to copy and ...
0
votes
2
answers
188
views
In dependency property pattern in WPF, automatically cast the result of GetValue() to expected return type
(Edit Note): I made a mistake not pairing my question with a simpler example to focus on the DependencyProperty repeated and wordy code issue and the LabeledConainer and LabeledTextBox are really ...
0
votes
1
answer
110
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
53
views
Is it possible to bind ItemsControl to a nested property [duplicate]
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 ...
0
votes
2
answers
134
views
WPF freezing, related to ICommand.CanExecuteChanged?
My implementation of RelayCommand implements ICommand.CanExecuteChanged event:
public event EventHandler CanExecuteChanged
{
add
{
CommandManager.RequerySuggested += value;
}
...
2
votes
0
answers
136
views
WPF Popup using Touch Input
I'd like to use a popup in an .NET WPF application.
<Popup x:Name="MyPopup" TouchLeave="MyPopup_TouchLeave" IsOpen="True">
<Border Background="Blue"...
1
vote
1
answer
89
views
XAML Avoid Repeating Column Definitions in DataGrid
Using WPF, I display golf results in a DataGrid. There are two rows per player in each DataGrid row, with 19 columns. The first row showing gross scores and the second row showing net scores.
<?...