170,046 questions
0
votes
1
answer
52
views
How do I make two asymmetrically linked CheckBoxes in XAML?
I have two CheckBoxes in XAML. When the first one is unchecked, I want the second one to be unchecked. But when the first one is checked, I don't want anything to happen with the second one. I also ...
-1
votes
1
answer
138
views
Notify when property of nested object changes using MVVM Toolkit in WPF
In my WPF application, I want to build a graph where I sum up a "measured" current and display this for every graph element.
I tried using the MVVM Toolkit for this and set up 2 classes:
...
0
votes
1
answer
39
views
How to make styles behave similarly treeview with child controls
I have a treeview with various controls in a treeviewItem, Textblocks, textboxes, checkboxes, and radio buttons. The problem is strictly cosmetic and only applies to when the treeview node is selected....
-1
votes
1
answer
166
views
How do I remove (or close or dispose) current page from frame in WPF?
I have a MainWindow with some buttons for navigation. These buttons opens up a Page in a Frame and of course this page gets added to the Frame's navigation history.
Now let's say I have 6 open pages ...
0
votes
0
answers
53
views
My WPF application crashes intermittently when working with multiple windows
I have an application built with WPF using .Net framework 4.8 and windows APIs which runs as a windows application and opens an excel app (separate excel process) and from the excel app opens up a ...
0
votes
0
answers
40
views
How to create a ControlTemplate for a DevExpress EditorControl
I'm trying to customise the DevExpress ButtonEdit control in WPF. What I have so far is:
<ControlTemplate x:Key="ButtonEditControlTemplate" TargetType="{x:Type dxe:ButtonEdit}"&...
1
vote
1
answer
77
views
How do you get a WPF window with a theme from a dll to show properly? [duplicate]
I'm new to WPF and I'm converting a WinForms application that I wrote years ago to WPF. This application is an addon to another application and I have to create it as a dll.
I started this as an ...
0
votes
1
answer
197
views
WebView2CompositionControl displays content blurred
I'm using a WPF WebView2CompositionControl to display an instance of Monaco Editor, but the content is blurry.
At first I used the WebView2 control but this control has the issue that it is always ...
3
votes
1
answer
117
views
How to shorten the length of a .Net C# System.Windows.Shapes.Line at runtime?
Before I illustrate my question with words please imagine a 2D square on a screen. In the center of that square is an archer with a bow.
In every corner of the square is a target. When a point on a ...
0
votes
1
answer
72
views
How can I make a WPF control appear only when clicked, in compliance with MVVM, without code behind?
I have nested collections of items which I represent as ItemsControls nested in each others' ItemTemplates. Here are the simplified DataTemplates:
<DataTemplate x:Key="PTemplate">
&...
-1
votes
1
answer
76
views
Message box repeating under loop with Cancellation Token
I have a method with switch condition to perform different operations under while loop with Cancellation Token as mentioned here.
private Task MessagesAsync(CancellationToken cancelToken) => ...
3
votes
1
answer
198
views
What is the correct way of hosting a blazor application in a wpf application?
I am currently working on extending my WPF app with a Blazor web interface to allow users to configure some settings through their browser. To achieve this, I launch a Blazor server app from within my ...
0
votes
2
answers
282
views
C# project can't find System.Windows.Forms even with references
Beginner here in C#.
I wanted to make a project in C# with the help of WPF. It is my first time doing this. All worked fine, apart from that FolderBrowserDialog and System.Windows.Forms.DialogResult....
1
vote
0
answers
91
views
How to change display modes smoothly between duplicate (mirror) and extend
I have a WPF app that displaying in full screen and using extend display mode to show 2 screen: the 1st screen is the main app, and the 2nd screen is always show an image as a waiting screen. I want ...
0
votes
2
answers
83
views
EF Core entity to self detect that its data has been loaded from the database
I am using EF Core v9.0.3 with WPF. How can I get the entity to detect when its data has been loaded from the database?
I want to populate an un-mapped proxy List<> on the entity from a string ...
0
votes
1
answer
103
views
How to capture Touch-Pad 2 finger double tap in WinUI 3 / WPF C#
In my app, I want to capture touch pad double click and perform an action for accessibility (read something aloud). However, this action is different from mouse right click. I used different codes but ...
-1
votes
1
answer
73
views
How to have a summary-like textbox [closed]
I want to have a textbox with the following logic:
Meaning, some text and the dots until reaching a predetermined width and a number. I am aware that since I am not using a monospaced character the ...
0
votes
1
answer
62
views
How to customize RadioButton in WPF?
I'm trying to customize the RadioButton button, but nothing changes in it. Why? And how to customize RadioButton to make it look like this: this is how it should look like
Also, can you tell me how to ...
0
votes
1
answer
110
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....
-1
votes
2
answers
95
views
TextChanged event in WPF never triggers. How to trigger this event?
In my MainWindow.xaml, I have:
<StackPanel Orientation="Horizontal" Margin="0,5">
<TextBlock Text="Split Size (MB):" FontSize="18" FontWeight="...
0
votes
1
answer
66
views
The color of the active button is reset instead of remaining, why?
I'm writing a style for buttons that will change color when hovering and clicking. Yes, when I click on the Foreground button, the color changes, but as soon as I move the cursor away from the button ...
0
votes
0
answers
57
views
How to animate a Border with its content, plus ComboBox (including dropdown)?
So I found this button animation trick on StackOverflow:
<Button.Styles>
<Style Selector="Button">
<Setter Property="FontSize" Value="14" />
...
0
votes
1
answer
81
views
I can't find a way to change the WPF Treeview togglebutton's size
I have an application on production with a TreeView control but when the client want to expand or collapse the tree, he finds it very annoying to click on the toggle button because the button is too ...
0
votes
0
answers
35
views
How can I remove the black header that appears on my WPF DataGrid?
I am building this table on WPF .NET 8
<DataGrid x:Name="dataGrid"
Width="640"
ClipToBounds="True"
AutoGenerateColumns="False"
...
0
votes
1
answer
119
views
Changing .NET Application Icons Dynamically
I am creating a C# WPF application that will only run on Windows and that will end up being presented with two different brandings. The application is identical, it is just the branding that needs to ...
0
votes
1
answer
42
views
How can I complete editing of a WPF DataGrid cell when a user clicks a button?
I have a WPF DataGrid. The user enters some data and clicks a button to process the data. If a cell is still being edited, all of the row values are null. Is there a way to force the editing to be ...
0
votes
1
answer
70
views
How to communicate between usercontrol and mainVM
I have developed a WPF application consisting of a main window and two user controls. The first user control contains a button, and the second user control has a textbox. The main window includes a ...
0
votes
0
answers
40
views
Incorrect Databinding in WPF MVVM application [duplicate]
I'm trying to create a WPF application following the MVVM pattern that tracks Event models, which have some typical data for an event (title, date, time, etc.). My app is set up with two views inside ...
0
votes
1
answer
131
views
WPF DataGrid extremely slow scrolling
I need to implement a spreadsheet like control in my WPF app, and all my attempts at using the WPF DataGrid have resulted in very poor scrolling (it is worse in horizontal than vertical).
I have tried:...
0
votes
0
answers
29
views
My dragvisual appears with a wierd offset
I have currently the Problem, that my dragged Visual offset is depending on the Current adornerlayer, I tried it with a adorner decorater but it doesn't seem to work.
I want to achieve that the drag ...
0
votes
1
answer
77
views
What is the correct implementation for unit testing a WPF application using dependency injection?
I have a singleton model class (Project) shared application-wide through dependency injection.
Works great in the application.
I have another model class (Analysis) that accesses this singleton that I ...
0
votes
0
answers
140
views
System.Windows.Interactivity reference resolving to Microsoft.Xaml.Behaviors
A customer currently running an older version of an app experienced an error after successfully upgrading the software: Could not load file or assembly Microsoft.Xaml.Behaviors. However, this assembly ...
0
votes
1
answer
80
views
Context Menu does not register click event to fire command xaml and c#
I have some code to display a list of object type waiters and inside that object is a list of customers objects assigned to that waiter. Each customer can be checked in the list. I have a context menu ...
-1
votes
1
answer
92
views
Binding with DataTemplate according to DataType [closed]
Binding a ContentControl to the selected item of a treeview I can't get DataTemplate to show something according to DataType:
<ContentControl Grid.Column="1" Grid.RowSpan="3" ...
2
votes
1
answer
88
views
Compilation Issue in WPF Application with Linked XAML Files
I have a WPF application project that includes two separate windows (in addition to the main application window), each defined in separate projects that are not included in the solution, using the <...
0
votes
1
answer
105
views
WPF TreeViewItem Style : TreeView Line Limit Questions
If you look at the lower line of 3LvSub in the image above, it should be cut off at 4LvSub
It's going to Lv5 How do I fix it?
Below is the style I used.
<Style x:Key="TreeView.Lv3"
...
0
votes
1
answer
138
views
How to put two triangles in a button
I am trying to create a button that has two triangles. One in the top right corner and one on the bottom left corner as shown below. And each would be displayed based on a boolean value (for example, ...
0
votes
0
answers
76
views
Dynamic CellTemplate in WPF DataGrid with dynamically bound column
This question has been asked in some form in some old threads, but having scoured them for hours and not found any satisfactory answers, I thought I would resurrect the question and see if I can get a ...
2
votes
1
answer
108
views
Path of ResourceDictionary for WPF in PowerShell
I am working on a PowerShell (Core, 7) module that shall have a WPF GUI. I want to organize the code in a better way, splitting up the XAML, e.g. Styles.xaml, Colors.xaml and Templates.xaml.
The code ...
0
votes
1
answer
93
views
WPF CollectionViewSource not updating UI
I have a very simple application, where I want populate the ListView when the user presses a button. I am using CollectionViewSource to update the ListView when the button is pressed, but I cannot ...
0
votes
1
answer
70
views
Understanding %temp%\.net Folder
When developing a single file self-contained WPF application using .NET 8 that uses the WebView2 component, a folder is created under %temp%\.net while the application is running.
What is the purpose ...
1
vote
0
answers
49
views
How to print WPF Canvas with custom paper size via EMF (without using DEVMODE)?
I'm developing a WPF application that needs to send print jobs to a USB-connected printer using custom paper sizes. The printer and its driver support this (verified using 3rd party software), but I ...
0
votes
1
answer
64
views
ImageSource of Image.Tooltip unreachable
In the code behind I cannot seem to access the Image (or any child) control of a Tooltip of an Image.
Setup:
I have a UserControl with an image that on hover displays a tooltip with a larger version ...
0
votes
1
answer
155
views
Community Toolkit WPF MVVM [Observable Property] not updating UI
I'm new to the toolkit and have made a couple of simple applications to test various scenarios. This time I've hooked up Entity Framework to start building a bigger application.
Unfortunately I've ...
0
votes
0
answers
30
views
Extract and Search for "Binding" Expressions in BAML/XAML from a .DLL Using ILSpy and Mono.Cecil
I'm working on a C# application that extracts and converts embedded BAML resources from a .DLL into XAML using ILSpy and Mono.Cecil.
The current implementation successfully retrieves and prints the ...
0
votes
0
answers
38
views
Edit DataGrid in another window without auto update
I have a read only DataGrid in MainWindow populated with a list of a custom type. I want to edit each row separately in another window that uses TextBoxes. I get to bind everything correctly, but I ...
0
votes
0
answers
26
views
BluetoothDevice in WPF consumes too much CPU
I am creating an app for monitoring earbuds that are paired with my PC. The app is made using WPF and .Net 8.0. When the app is kept open without interaction (idle), it has a low CPU usage. However, ...
0
votes
1
answer
120
views
The underlying connection was closed: an unexpected error occurred on a send in a C# & WPF app on Windows XP
I get error
The underlying connection was closed: An unexpected error occurred
on a send on connecting via https on Windows XP in my C# app. How to make the https connection working on Windows XP?
...
-1
votes
1
answer
104
views
WPF screenshot not saving correct size [closed]
Hey all I am trying to figure out why my output is not looking like I am wanting.
Currently my layout looks like this:
<Window x:Class="howto_wpf_number_icons.Window1"
xmlns="...
0
votes
1
answer
96
views
How to automatically split window vertically in Visual Studio?
I have a problem, I can't seem to find the solution to automatically save the window layout in Visual Studio. I wanted to always make the document be split vertically in all instances. Meaning, if I ...