170,046 questions
0
votes
0
answers
92
views
How to get the displayed rows of a DataGrid in view model in WPF
I would like to change the style of some DataGrid columns / cells (background, font weight, etc.) based on regular expressions.
I have more than a few thousand rows and about 20 regular expressions to ...
0
votes
0
answers
52
views
WPF Border within Grid causes visible lines in UI
I am designing a set of custom controls in WPF. For GroupBox it is mainly Controls.Border within a Grid. Unfortunately the borders of these visual elements are visible in WPF designer as well as in ...
0
votes
1
answer
94
views
WPF Loaded or Initialized [closed]
I have two XAML/WPF user controls forms. The first one has button event handler that when triggered causes my second form to open.
private void AutoSetupPageOneConfirmButton_Click(object sender, ...
1
vote
1
answer
104
views
WPF Listbox use DisplayMemberPath with ItemTemplate for dynamic property display
I am having difficulty finding a way to use a DataTemplate in my ListBox and still be able to use a DisplayMemberPath which is dynamically assigned (please note this is a requirement). I have read ...
0
votes
0
answers
76
views
How to Change Snackbar Background Color Based on Severity in Material Design Toolkit for WPF?
I am using the Material Design Toolkit in a WPF application, and I want to change the background color of the Snackbar based on different severity levels (Info, Warning, Error, Success).
Currently, my ...
0
votes
3
answers
217
views
How to Update a Property in a Parent Class When a Nested Property Changes in a
I'm using a custom FullyObservableCollection class that extends ObservableCollection, where T implements INotifyPropertyChanged. The idea is to have a collection of objects that not only notify ...
-1
votes
1
answer
106
views
Using Scrollviewer on UniformGrid
I'm struggling a lot finding a solution to my problem. I can't understand why my view is breaking as soon as I wrap it inside a scrollviewer.
The layout idea is the following:
<ScrollViewer>
...
0
votes
1
answer
78
views
Automatic Row DataGrid C# WPF
I'm trying to add DataGrid with the feauture to auto add row in the last one. so if the row is filled by pressing Enter of Tab or clicked away a new Row should be inserted.
This code worked 1 time ...
0
votes
0
answers
33
views
How can I get the WPF ResizeGrip control and the Cursor to sync in position when I move the mouse using ScaleTransform?
I have a WPF desktop app that has a grid control that floats on the screen. With the code below I resize my grid with a ResizeGrip located on the bottom right corner of the grid. I have attached the 3 ...
-1
votes
1
answer
98
views
How to pass data into a particular item of ItemsControl [closed]
I have a ScrollViewer inside of which there's an ItemsControl element, inside of which I want to display custom views and pass data into them using bindings.
The individual items are of ...
0
votes
1
answer
55
views
Implicit Style of TextBlock in DataGrid only applied when declared in App.xaml
I don't understand why an implicit TextBlock-Style is not applied in a DataGrid, unless defined in the App.xaml code. IMO it foiles the rule: the nearer to the possible consumer in the VisualTree, the ...
0
votes
1
answer
76
views
WPF - d.DataContext - how to initiate data in design like at run-time?
I need my SharedViewModel to be set in design time to display data in my UI
as I run the app, I see data on the screen, because OnLoaded runs LoadStuffs
LoadStuffs initiates the SharedViewModel and ...
0
votes
0
answers
108
views
Excel "we found a problem with some content" error when saving existing document using EPPlus with WPF
I'm attempting to insert info into an Excel document and save it using EPPlus. Should be a very simple task, but seems it messes up the document. It distorts images, doesn't register numbers properly ...
1
vote
1
answer
96
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 ...
1
vote
1
answer
113
views
How to pass INotifyDataErrorInfo Errors into nested user controls in WPF?
I have a WPF application where I have 2 custom UserControl, both have the characteristic that are reusable. The first user control is an FormGroup where exposes a label and a reference to the other ...
1
vote
0
answers
80
views
How to Identify the Version of ffmpeg.dll in WebView2 Runtime Fixed Version
I am currently using the WebView2 runtime fixed version. After expanding the package, I found multiple DLL files, including ffmpeg.dll.
In the file properties, the file version is displayed as 0.0.0.0,...
0
votes
0
answers
98
views
LiveCharts V2 WPF gauge does not update
I am currently rewriting my program, updating it to LiveCharts V2 and ran into the problem that I can't get my gauges to update.
I am using an ObservableCollection, as advised in the documentation and ...
0
votes
0
answers
41
views
Centering grid inside user control causes rest of window to have white bars around it in WPF [duplicate]
I recently started using WPF and I managed to fix most of issues I have, but one I can't fix is, when I set grid horizontal and vertical alignment, it had white bars around and won't fill the ...
0
votes
1
answer
88
views
WPF window status bar disappears when window is sized smaller
I've been playing around with c# and WPF for about 3 weeks now trying to create a plugin to get things done faster in Revit. I've solved most problems by myself, but this one I could really do with ...
0
votes
0
answers
40
views
How to style XAMDataGrid filter label icon?
I'm using the XAMDataGrid from xmlns:igDP="http://schemas.infragistics.com/xaml/wpf" namespace. Following is my data grid
<igDP:XamDataGrid Grid.Row="1" Margin="3 3 6 3&...
0
votes
0
answers
52
views
How to fill a Combobox inside a DataGrid with the Content of a DataTable
I have a DATAGRID and fill it with a DataTable.
The table has columns that contain an ID (ValidationID) on a DataTable PTable with different values that I want to display as a combo box in the ...
0
votes
1
answer
84
views
How to declare XAML namespace for System.ComponentModel [duplicate]
I am trying to import the System.ComponentModel namespace as scm as indicated in this SO answer here.
Added the nuget package as below.
<Project Sdk="Microsoft.NET.Sdk">
<...
0
votes
1
answer
54
views
WPF window covering all screens at the same time
I want a WPF window to cover all monitors.
<Window ... WindowStyle="None" ...
In app.manifest DPI Awareness is enabled:
<application xmlns="urn:schemas-microsoft-com:asm.v3&...
0
votes
1
answer
52
views
Controls inside unselected TabItem are not fetched for validation
In my legacy wpf application I have to validate ALL the controls inside a tabcontrol, included those contained in the unselected tabs.
Thw following style is applied to my TabItem:
<Style x:Key=&...
0
votes
0
answers
122
views
How to debug XAML binding failures
I am currently working on a big C# application using DotNet8.0 and WPF.
The current view has multiple ComboBoxes, each looking similar to this example
<ComboBox Name="cboAdapter" Grid....
0
votes
1
answer
70
views
C# WPF Button - How to pass two items/parameters into command?
I have a DataGrid within an ItemsControl, like shown below (Representing a collection within a collection).
When I place a button within a DataGrid cell, can I bind the command so that 2 parameters ...
1
vote
0
answers
52
views
WPF ToggleButton group - only one button checked at a time [duplicate]
I have an ItemsControl in my WPF application that displays a list of ToggleButtons. Each ToggleButton represents a file path, and I want only one button to be selected at a time. Clicking a button ...
0
votes
1
answer
87
views
XAML ComboBox Styling Not Applying: Background, Selection, and Hover Issues
My markup does not want to change the background of neither the ComboBox nor for the selected ComboBoxItem. It additionally does not change the hover color of ComboBoxItems. How does this make sense? ...
0
votes
1
answer
101
views
How can a WPF application wait for windows to be fully opened by the UI thread before processing them?
I need to build an application that opens complex windows (windows that take about 1 minute for the UI thread to open them). Then, once they are open and loaded, start generating images of these ...
2
votes
1
answer
163
views
WPF drag and drop outlook email
In a WPF application with .net 8 I'm trying to implement drag and drop from emails dragged from MS Outlook, and save the dragged mail to disk.
This is my code:
private void OnDrop(object sender, ...
-1
votes
1
answer
86
views
C# wpf application can not make a second call to a wcf service
I have a wcf service published on my windows server.
I have a simple method which makes a simple db query in the service :
public bool HasActifContract(string accountNumber)
{
try
{
...
0
votes
0
answers
94
views
ComboBoxEdit in DevX WPF, added within the GridColumn's CellTemplate, displays the selected item of the ComboBox in another ComboBox while scrolling
I am using the DevX WPF GridControl and ComboBoxEdit within a GridColumn's CellTemplate. For each row in the grid, there is a ComboBoxEdit with a selected item. Each ComboBox has its own ItemSource, ...
2
votes
0
answers
106
views
Button command stops working after minimizing to system tray
I have a WPF application that listens to copy events and stores clipboard items in a ListView. Each ListViewItem contains a button that executes a command (EditClipboardTextCommand) to open an ...
1
vote
1
answer
100
views
WinUI 3 Radio Button Centering
I'm trying to convert a WPF C# application to use WinUI 3. This is a simplified version of my XAML code:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>...
0
votes
1
answer
103
views
How to get the correct text Alignment to the Right in AvalonEdit
Initial data - Text alignment to the Left
Creating an event handler
and I get the following result, but it's not correct.
The correct behavior is shown in the picture, but this is a TextBox.
How ...
0
votes
0
answers
102
views
How to add a UserControl specific ViewModel but still reach the Dependency Property changed callback in WPF
I would like to create a WPF class library based on a TreeView to visualize JSON strings.
I define a JsonProperty DependencyProperty which I wan't to use to pass the JSON string. I'm able to get the ...
0
votes
1
answer
72
views
WPF IValueConverter -- who passes the targetType and culture parameters?
Let's say I have a very simple converter for DateTime that I want to display according to some CultureInfo.
[ValueConversion(typeof(DateTime), typeof(string))]
public class DateTimeToStringConverter : ...
0
votes
0
answers
98
views
I have a problem with C# Class Add. Microsoft Visual studio issues the following error: XDG0008 `The name "" does not exist in the namespace ""`
I can't figure out the cause of the problem.:
The name "BoolToVisibilityConverter" does not exist in the namespace "clr-namespace:WpfApp1".
Although I seem to have specified ...
0
votes
0
answers
41
views
WPF DataGrid Grouping Expansion state and virtualization
I'm having a DataGrid (WPF).
Virtualization is activated:
EnableRowVirtualization="True"
EnableColumnVirtualization="True"
...
0
votes
1
answer
102
views
WPF Datagrid enum combobox column
In a WPF DataGrid, if I use AutoGenerateColumns and bind it to my collection of class objects, it displays enums as a combobox automatically where I can choose between all options available in the ...
0
votes
1
answer
50
views
Pin a control to the bottom of another control, or the bottom of the window, whichever is higher
I have this scenario:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition ...
0
votes
1
answer
49
views
Wpf Edit Cell on e.Cancel
I have a WPF DataGrid and I'm trying to handle a scenario where an item does not exist in my ViewModel. When this happens, I display an error message and attempt to set focus back to the DataGrid cell ...
0
votes
0
answers
27
views
ComboBox FontWeight binding in a CellTemplate of a DataGrid from the Main VM and not DG ItemSource
I have a DataGrid that is bound to a ObservableCollection of named Views (ViewItem). I have a CellTemplate column that I have a ComboBox inside a DockPanel that I am binding to an ObservableCollection ...
0
votes
0
answers
56
views
Avalonia/WPF Passing a Router into a ControlTemplate
Long story short, I have an Avalonia project where I'm using the SimpleRouter library to achieve routing. The code is very similar to the full code example, using a ServiceCollection and I can access ...
-2
votes
1
answer
114
views
C# WPF buttons icon size on high DPI problem
I have a problem with button's icon size under high resolution and DPI (200%).
Under 1920x1080 100% everything is fine:
https://i.sstatic.net/fzrDEXa6.png
Under 2880x1800 200% the icons are too small:
...
1
vote
1
answer
84
views
Can I save a TextRange inline property to RTF in WPF?
So I'm writing a project that mimics Word.
The setup is relatively simple:
I get a nvarchar(max) from a database. This is to save the rtf content.
I convert the rtf when the RichTextBox is loaded.
...
0
votes
1
answer
114
views
WPF Custom ComboBox with filtering becomes unresponsive when deleting characters
Scenario:
I'm implementing a custom ComboBox in WPF with a filtering feature:
The ComboBox contains a Popup with a TextBox for filtering.
Below the TextBox, a list displays only the items that match ...
0
votes
0
answers
133
views
WPF OpenFileDialog generates errors when debugging but not in "no debugging mode" VS2022
I have a very straight forward OpenFileDialog box that is triggered from an event associated with the click event on a button on a WPF form.
When I run this simple form in debug mode...
<Grid&...
1
vote
2
answers
423
views
WPF: Asynchronous operation on window close
I need to perform an async operation when the window is closed (basically, to save all my data). The problem is that the program and the UI thread dies too soon and the task never completes.
This is ...
0
votes
0
answers
40
views
How to Snap a Path Element to the Nearest NURBS Path in a WPF Canvas?
Question:
I'm working on a WPF application where I need to implement functionality to drag and drop Path elements onto a Canvas. After the element is dropped, it should snap to the nearest NURBS path (...