5,731 questions
-2
votes
0
answers
75
views
Is it possible to dynamically create buttons in WPF based on the number of devices set in an INI file? [duplicate]
Assuming the number of devices is set in the config.ini file as follows:
[Device]
Count = 10
When my WPF program starts, I want to automatically create buttons based on the Count value. For example, ...
2
votes
0
answers
127
views
In case of large number of items Context Menu is slowing down WPF application view rendering
I have following context menu defined as a part of the DataTemplate in xaml:
<DataTemplate DataType="{x:Type viewModel:OverviewAnnotationItemViewModel}">
<views:...
2
votes
1
answer
77
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="...
0
votes
0
answers
18
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'...
1
vote
0
answers
66
views
How to create a base style for rounded button in WPF XAML? [duplicate]
I created a WPF Class Library so that it would contain base styles that will be used in WPF application. In that class, I wanted to create like base styles for like buttons, expanders, etc. where say ...
2
votes
0
answers
58
views
WPF Custom Control VisualState affecting other instances when using StaticResource for themed colors
Problem:
I've created a custom WPF Button control with a ControlTemplate defined in a ResourceDictionary. This template uses DynamicResource for initial Background and Foreground properties (to ...
0
votes
0
answers
86
views
WPF FlowDocument: how to make Table to size to content and not full page width?
I have FlowDocument containing simple Table with two columns with short content. And I want Table to not size to full page width but to minimal required width, according to content. And I want Table ...
1
vote
1
answer
54
views
WPF .NET app: how to set MenuItem text background style triggered when MouseOver its Parent is True
I've managed to edit the copy of the Menu and MenuItem template to be used as styles for respective Control Elements with the triggers shown in the code snippets below
The problem is i couldn't figure ...
0
votes
0
answers
141
views
WinForms Guna UI: Controls with Top-Right Anchor jump during side menu animation(2025)
Issue Summary:
I'm working on a WinForms application using the Guna UI 2 library. I have a collapsible left side menu (Panel) that expands/collapses using animation (Timer).
The problem:
Controls ...
0
votes
0
answers
61
views
Duplicate Points from Scatter Plot are displayed in Live Charts Core
I'm new to C# WPF and Live Charts Core, and I'm trying to build up my knowledge in that field. I have an application that shows every second the output that comes from a random number generator as a ...
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 ...
-1
votes
1
answer
103
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
0
answers
87
views
WPF UI ContentPresenter Dialog Appears Behind WebView Loaded from Navigation
I'm building a WPF application using WPF UI. In my MainWindow, I have a NavigationView that loads pages when menu items are clicked. One of these pages contains a WebView, and that page has a button ...
-1
votes
1
answer
68
views
Custom Control Partial declarations of 'DigitTextBox' must not specify different base classes
I'm building a Custom Control. Added an event to the xaml. Compiler complained, I added an x:Class entry. Then it complained that my class needed a partial verb. And now it's complaining: "...
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 ...
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 ...
1
vote
1
answer
79
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 ...
1
vote
0
answers
46
views
WPF: Expander inside another Expander
I have an Expander in my WPF application and it works fine. I have a property called AAA inside my own DataContext called BBB and this object contains an ObservableCollection of Products. This ...
0
votes
1
answer
57
views
Unsetting property value that was set in the default style
Working on an application that has areas, with different foreground color for each area.
Generic skeleton of the issue would look like this:
<Window Style={StaticResource GrayForeground}>
&...
0
votes
1
answer
48
views
WPF Datagrid Itemsource Parameter not calling the setter when child object is changed
i am working on a WPF application using caliburn micro.
I have a datagrid which has a list of a custom model as the itemsource.
The Model looks like this:
public class ProductModel : Screen
{
...
0
votes
0
answers
76
views
Unable to Retrieve the Correct Size of On-Screen Keyboard (TabTip.exe) Using Win32 APIs
I am currently working on a C# application where I am trying to interact with the On-Screen Keyboard (TabTip.exe) using Win32 API calls, specifically FindWindow, GetWindowRect, and SetWindowPos. ...
0
votes
1
answer
55
views
What makes my custom ContextMenu throw System.Windows.Data Error: 4?
I made a custom WPF ContextMenu to show buttons in a strip on top or at the bottom of the menu, much like the copy/paste buttons in the Windows 11 Explorer context menu.
Everything works, but in the ...
0
votes
1
answer
54
views
WPF ContextMenu unable to disable highlighting on mouse over
I am unable to disable the highlight effect on a MenuItem when hovering over it in a WPF ContextMenu. The issue is shown in the image. This only occurs when I bind the ContextMenu to an ItemsSource. ...
0
votes
1
answer
86
views
How to reverse the order of columns in WPF Grid layout?
I am building a WPF application in C#.
I am trying to implement a two column layout using Grid layout, similar to a browser sidebar.
Grid is implemented as a 3-column layout because I am using a ...
2
votes
0
answers
77
views
Button stuck in hovered state on touch in WPF Touch Application modal window
I'm developing a WPF application designed for touch screens. There is a modal window with button "New" on it. The button has 3 states:
Normal:
Hovered (orange background):
Pressed (orange ...
0
votes
1
answer
50
views
What internal mechanism triggers a ListBoxItem to be selected?
I'm trying to understand the details of WPF,but hit a stumbling block. I know that Selector is an abstract class that inherits from ItemsControl and adds the ability to select from its children. I ...
0
votes
1
answer
47
views
Can WPF actually handle multiple button touches simultaneously? If so, what is the best approach?
I have an WPF app running on a touchscreen where the user needs to hold down one button (The HOLD button) to enable a second button (the GO button). The idea is this accidentally prevents the user ...
0
votes
1
answer
69
views
WPF - Size of Controls to fit in Nested Grid
Using WPF, I have a layout that is a series of nested grids, because my understanding is that that is better at preserving the look I want than using RowSpan. Each resulting Grid section is a region, ...
0
votes
1
answer
60
views
WHY System.Windows.Markup.XamlParseException: ''Provide value on 'System.Windows.StaticResourceExtension' threw an exception. ERROR
Idk why I have this error:
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas....
0
votes
1
answer
74
views
WPF Application to zoom on screen content
Currently checking on a control that zooms the content on screen of a wpf application.
Struck in calibration part as the zoomed content of the content that is underneath the cursor needs to be shown ...
0
votes
1
answer
71
views
Size control by available space, not contents
Right now I'm having this problem with controls that can display variable data of indeterminate size. For example, a TextBox displaying a long file path or a ListBox displaying error messages. This ...
0
votes
1
answer
68
views
Event triggers to style another component
I am creating some custom components for a project that I am working on, and I've run into an issue that I am having with styling a user component (I know it's a bit messy, I was planning on cleaning ...
0
votes
1
answer
84
views
ContextMenu doesn't open when I use right click from code behind
I am trying to emulate right click from the code behind like so:
static void RightMouseClick(Visual visual)
{
UIElement uel = (UIElement)visual;
var e = new MouseButtonEventArgs(Mouse....
0
votes
1
answer
102
views
VB.NET WPF - How to access an instance of a user control
I am making a WPF application for quoting, and in one of my windows (defined as a user control, not a window), I have a print button that successfully renders the window to a bitmap and then into an ...
0
votes
3
answers
230
views
How to remove padding on the left and top of MenuItem.Icon?
I am using .Net 8.0 in my WPF project and also MaterialDesign. My problem is that I want to create a Menu where the root MenuItem has a plus icon, but for some reason trying to create an icon the size ...
0
votes
2
answers
49
views
Having a hard time getting visibility collapsed to behave the way I want
I have a section of my form defined this way:
<Grid Margin="380,69,10,50" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid....
0
votes
0
answers
52
views
WPF Frame Navigation: Preventing Duplicate Instances in Navigation History
In my WPF application, I'm using a Frame for navigation between pages. The issue I'm encountering is that whenever I navigate to a page that is already open, a new instance of that page is added to ...
-2
votes
1
answer
42
views
Wpf change the Visiblity of button if the checkbox is not checked
This is my recourse converter
<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
And I have 2 buttons and 1 checkobox
the add button I want to show if the checkbox is ...
0
votes
1
answer
46
views
Disable Drop inside DataGrid cell during edit mode
My application is a wine bottle/wine rack tracking tool that allows the user to quickly look up the location of a specific bottle of wine inside a collection of wine racks. I have drag and drop from ...
0
votes
0
answers
52
views
Dynamically set the text for data template button
I am trying to work on a WPF project, I have a XAML that defines items control as below, and uses Button for Data Template. And It uses Button with hardcoded text as "Text #1/2/3/4". However,...
1
vote
2
answers
573
views
How to change the content of a NavigationView (Lepoco WPFUI)?
Recently, I am making a project, which involves in using WebSocket. However, after I received the message on MainPageWindow.xaml.cs, I have to change the content of a label on FriendPage.xaml (An User ...
1
vote
0
answers
38
views
Attached property cannot be created in XAML from designer property window when assigned a TypeConverter
I have a working attached property defined like below
public static class UiExt
{
public static readonly DependencyProperty UiDataProperty = DependencyProperty.RegisterAttached(
...
1
vote
1
answer
533
views
How to let a window use default style but not the UI framework (Lepoco WPFUI) style in WPF?
Recently, I added Lepoco WPFUI UI framework to my project, but I have one window that I want it to use the default style. In this case, I tried some ways but they did not work.
Here is my App.xaml:
&...
0
votes
0
answers
53
views
Installed Exe is showing different culture than debug/portable exe in WPF
Installed Exe is showing different culture than debug/portable exe in WPF
Above picture is the amount input of Debug exe in nl-NL culture (Netherland) I have added property currentculture because my ...
0
votes
1
answer
39
views
I am trying open a new form inside a panel of another form. But control is not passing
[enter image description here][1]I am trying open a new form inside a panel of another form. But control is not passing. I am providing the code snippet below. The code is written in C# windows form.
...
-1
votes
1
answer
64
views
Most concise way of creating a WPF custom control as a composition of other existing controls
I need to create a new control which is composed of a TextBox and a Button. The most concise way I've found at the moment is with a CusomControl like this:
inherit from TextBox and add the ...
0
votes
0
answers
68
views
Overlapping issue when Panel's Content exceeds available space, Panel and its Content becomes last layer when comes to overlapping
I am currently developing a card game in WPF, where the user can drag cards from their hand. A dragged card should be always on top when overlapping other controls. Simplifying the problem, lets take ...
1
vote
4
answers
196
views
How to bind generic generated checkboxes with enum flags in WPF?
We have a Person who can have several Skills (Strength, Intelligence and Luck). In our WPF-Application, we want to bind these Skills to Checkboxes. When a Person has these Skills in his list, then the ...
0
votes
1
answer
47
views
WPF 40 px are always overflowing the window on the right
in my WPF Application, i have a own created widget (Gantt).
Here is the InitializeUI() in the main Window of Gantt:
private void InitializeUI() {
canvas = new Canvas
{
...
0
votes
0
answers
55
views
WPF Attached Property cannot be found [duplicate]
I have made a Template for a TextBox control that contains two buttons:
<ControlTemplate x:Key="TwoButtonField" TargetType="TextBox">
<Grid>
<Grid....