Questions tagged [wpf]

Windows Presentation Foundation, or WPF, is a subsystem for rendering user interfaces in Windows-based applications.

Filter by
Sorted by
Tagged with
0
votes
2answers
15 views

Cannot get selected ComboBox items in MainWindow.xaml.cs

I'd like to access ComboBox items (which are defined in another class) in MainWindow.xaml.cs, but I can't. I'm new to C# and WPF. The purpose of this code is to get a selected ComboBox item as a ...
2
votes
0answers
9 views

How to bind to calculated property using multiple dependency properties

I'm trying to build a WPF UserControl that I can reuse throughout my project. It's basically this: Horizontal line (called top line) Text block - Horizontal line (bottom line) When the window ...
0
votes
0answers
13 views

Visual Studio 2019 Community cannot create WPF App (.NET Core)

When I try to create a WPF App (.NET Core) in Visual Studio 2019 the following error appears: When I go to the spot I have it checked off already; Yes, I have restarted both VS and my computer. I ...
0
votes
1answer
26 views

On app startup Attached Property Callback Event return null for a Control property binding

Story & Problem: I create IsActivated property as an Attached Property to be able to add it to any control in XAML page I want. Then when any control set it to true, I want ...
0
votes
0answers
12 views

LogicalTreeHelper.GetChildren does not find anything within ContentTemplate [duplicate]

I have a ContentControl which tamplate is changed based on some value in DataContext. <ContentControl x:Name="params_control"> <ContentControl.Style> <Style TargetType="...
0
votes
1answer
22 views

EventTrigger in WPF

I want to get the SelectedItems from the Listbox where the Checkbox is selected via the InvokeCommandAction and store them in an obsevableCollection SelectedItems , but I am not getting the ...
1
vote
0answers
33 views

Dynamic rows and columns in DataGrid and for each cell write from a WPF control

I'm new to WPF and I'm trying to create a DataGrid with 4 columns defined "Ticket information", "Name", "Email" and "Zip Code". What I do is the following: System.Data.DataTable table = new System....
3
votes
2answers
60 views

WPF Currency symbol

I am using two different currencies in my software. Depending on company origin how can I show the currency before numerical data. Either £ or € <TextBlock Text="{Binding FNetPriceAfterDisc,...
0
votes
0answers
22 views

Very slow scrolling performance, using a wide canvas with a scrollviewer

I have a C# WPF application with a Canvas. The Canvas is wider then the screen, so I use a ScrollViewer on the Canvas. And everything is working fine. Here comes the problem: With a much wider Canvas ...
0
votes
0answers
24 views

How to handle drag & drop in WPF? [duplicate]

I've an ItemControl, which is bound to a sublist of ViewModel, so each ViewModel is displayed inside a StackPanel. Some of those viewModel represents an "empty" slot, some of them represent a "filled"...
0
votes
0answers
8 views

How to avoid further zoom out when the original image is reached using matrix transform

I am using matrix transform to zoom(scale) and pan(translate) the image using manipulation delta. After zoom in, when I perform continuous zoom out, the image is getting smaller than original image ...
-1
votes
0answers
12 views

How to increase performance for chart from System.Windows.Controls.DataVisualization.Charting [on hold]

I am using System.Windows.Controls.DataVisualization.Charting in my C#-WPF application. The data for the chart contains 4000 points. It is very slow. Has anyone an idea how to increase performance? I ...
-4
votes
2answers
47 views

Printed JPG image with mirrored output [on hold]

Hi Guys: i'm able to print with an SDk and the image is printing with correct size but the image is mirrored. How can i fix this? what is the error from the below code? public bool PrintImage(...
0
votes
1answer
40 views

Attached property always has a default value in a style

I'm working with WPF and I want to use attached properties to work with some styling things in the validation of the controls (my example of the problem is really simple, binding a simple text). This ...
0
votes
1answer
38 views

Enabling TextBox with trigger

I want a Textbox to be disabled, except the user hovers with the mouse over it. But this does not seam to work, the Textbox is still not editable if I hover over it. (Yes I know that this is unusual.) ...
-1
votes
2answers
39 views

Why can ListView rows get very very high randomly?

I have a ListView in the first row of a Grid. There is some data which fills each row by double clicking on items in the GridControl below. So the main idea of it is to click on a GridControl item so ...
0
votes
1answer
22 views

Exception in ShowDialog from different Window

I have a custom Window I want to show, when an unhandled exception occurs. Something like this: private void OnDispatcherUnhandledException(object sender, System.Windows.Threading....
-1
votes
0answers
24 views

C# WPF printable window [on hold]

I'd like to create a window which contains an A4 sized table or grid, where i could set its cells widths and heights freely. then i'd like to print this grid or table as an A4 pdf document. How could ...
-1
votes
0answers
24 views

Install WPF Application on Boot Camp Windows 10 [on hold]

We have a WPF application on .Net Framework 4.7.2. It installs and works fine on my and my colleagues machine that is Microsoft Windows 10. We have a user that has a MAC computer running boot camp (...
0
votes
0answers
18 views

Get Content from treeViewItem and Lost Focus

My treeViewItems don't works as well as expected when they lost Focus. Each treeViewItem are made of hierarchicalDatas, if it's a family they should behave a bit differently from their children. A ...
0
votes
1answer
15 views

How to avoid the focused cell color in grid control

I have a grid control,I don't need to show any default color(cell and row) when i clicked on the grid,I tried with some code to disable the default selected row color of grid but when i applied this ...
0
votes
0answers
17 views

Image print output size is different by using PrintDocument

Hi All: From my WPF applicaiton, i need to select the printer & its paper sizes then send an image to print to printi with the driver. The printed image output is completely differen, i used the ...
-1
votes
0answers
25 views

Getting and setting Radio Buttons WPF based on value [on hold]

I came across the issue of getting the value represented by selected radio button and setting a corresponding radio button based on a value. The setting is - I have a dialog with group of radio ...
-1
votes
0answers
10 views

Windows 10 ToastNotification in WPF via Service

I'm developing an application composed of two logical items: one service and on gui-application. The service is in charge of keeping the gui alive and launching it on system start. The GUI contains ...
-3
votes
0answers
86 views

How to always show drag adorner during dragging using GongSolution for drag and drop in WPF? [on hold]

Using the library GongSolutions for Drag and Drop I have come across the following issue: The created drag adorner is only displayed as long as the mouse hovers over a possible drop target. I however ...
2
votes
0answers
26 views

Changing ListViewItem background colour while using Material Design

I'm fairly new to WPF and I've run into a problem with my app design. I have UserControl with ListView and I need to change background colour of ListViewItems dynamically. When I add the following ...
0
votes
1answer
42 views

How do I fill the button background with a circle on click

I want to be able to click my button and on the click trigger I want the background to fill up with a circle, much like how a materialistic button would. I know there is a library for this but I'd ...
2
votes
0answers
26 views

How do we change Wireless Bluetooth Radio Power Management Programmatically C#

I am having problem with app that uses an external bluetooth device. When device is idle for some time Windows Turn the power to the bluetooth radio. When i uncheck Under Power Management Tab Of the ...
-1
votes
0answers
11 views

I export my viewmodel to view by mef.But it not work

I export my viewmodel by mef [Export("MainWindowViewModel",typeof(ViewModelBase))] [PartCreationPolicy(CreationPolicy.NonShared)] public class MainWindowViewModel: ViewModelBase { ...
0
votes
0answers
21 views

Content Control X:Name Not Disgustingly being picked up by Target Name is Data Trigger

I'm Working on a WPF Application that has a Particular Scroll Viewer which Contains Some names along with an Icon Distinguish to a particular Type.Right now I am encountering a problem where XAML ...
0
votes
1answer
10 views

WPF RadioButton Databinding with no selection

I've followed the example project at https://www.codeproject.com/Tips/720497/Binding-Radio-Buttons-to-a-Single-Property?fid=1853040&df=90&mpp=25&sort=Position&spc=Relaxed&view=...
1
vote
0answers
16 views

Display list of items in xceed datagrid cell

I have a collection of items that contains another list of items. Example classes: public class Item1 { public int Id {get; set;} public List <Item2> Items2 {get; set;} } public ...
0
votes
0answers
7 views

How to use R-Tree of NetTopologySuite in GMap.NET to display abundant marker WPF

I am using GMap.NET to display a lot of Marker (about more than 10.000 markers). R-Tree is a solution to optimize render markers at area which window is showing. STRtree in NetTopologySuite is a ...
0
votes
2answers
41 views

How to modify binding-path at WPF application runtime

I want to change the binding path SomeProperty to another at runtime. And the PropertyName can be any string ,so I can't set it before it running. how to do this? I tried "FindName" method to find ...
0
votes
0answers
9 views

Can we disable/enable tooltip dynamically in Livecharts?

I am using Livecharts in wpf to generate a multiple line chart. The number of lines can be varied from 1 to 36. For now, I have added a default tooltip which displays all the y-axis values of the ...
0
votes
0answers
25 views

How to edit arrays in a WPF DataGrid

I'm working on a WPF program for editing a proprietary script class. The model is composed of the following classes: public MethodCall { public Dictionary<string, object> Parameters { get; }...
0
votes
0answers
21 views

How to pass value into textbox from Page to main form in WPF?

Can't set value to textbox from Page to form I have a main form with frame where I load page Frame1.NavigationService.Navigate(New PieDonut2DChart.pagOpenTicketsByMember()) and textbox txtFrame1. ...
1
vote
1answer
33 views

Datacontext not available in DataGridTemplateColumn

I have the following grid: <DataGrid x:Name="CandiesDataGrid" ItemsSource="{Binding Candies}" SelectedItem="{Binding SelectedCandy}"> <i:Interaction.Triggers> &...
-1
votes
1answer
57 views

Is it possible to see the error message from WPF crashing? [duplicate]

When writing WPF application I often find that upon running new fucntions it will sometimes close, usually without an error message. This can make debugging challenging as I usually have to guess and ...
0
votes
0answers
41 views

CS0246: The type or namespace name '<type-name>' could not be found

I know this question has been asked before but alot of the solutions don't seem to work for me. I don't have any trouble building the solution, I feel like I'm missing something in my code maybe? I ...
0
votes
1answer
29 views

Losing Style trigger after Code-Behind changes background/foreground

I was trying to make buttons like discord's, which have three states. Active (after clicked), unactive completely and mouse over. All these three states change colors as you can see here: https://i....
0
votes
1answer
61 views

Why does this code not work when executed by a timer but works fine when called elsewhere?

I am using an API provided by a data vendor to pull data into a C#/WPF application. I have the connections working fine and data is pulling. I put in a check to verify periodically that connection ...
0
votes
0answers
27 views

WPF c# Inherited Dependency Object: how do you release instance events?

I am modifying the standard WPF Grid. On it I have several ObservableItemCollections that are dependency properties. These dependency properties have Property Changed Callbacks that set instance ...
0
votes
0answers
18 views

How to fix hWnd handler for popups in wpf on Windows 10 x86

We switched our target platform from Windows 7 x86 to Windows 10 x86. On this platform some of the popups have now and then a weird behavior with touch events. Funnily most of the time different ...
0
votes
0answers
11 views

Get UserControls dynamically via XamlReader.Load, IsLoaded is false at UI Elements

I try to save and load TabItems via XamlWriter and XamlReader at runtime so that the user can restore the previous session. Each TabItem consists of UserControls and standard WPF controls like grids,...
0
votes
2answers
40 views

Mandatory Use of Setting x:Shared=“False” Not Possible

This Question might be Very Similar to Questions such as Error when using x:Shared="False" resources in external assembly in WPF but I have not been able to find a Solution that I can Relate ...
0
votes
2answers
24 views

Binding a DataGridComboBoxCollumn to a IObservableCollection in my ViewModel

I'm at a learning project right now in which I have two models. User and Role. User has a reference to one Role object. I have a collection of both stored in my ViewModel as an IObservableCollection (...
0
votes
0answers
23 views

Navigation from a page to another page in WPF application

Program is this: I want to go to a specific page by a button click. I'm trying to load a page into another page. It compiles the program but when I click the button that I mentioned before, showing an ...
0
votes
1answer
14 views

How to make leftdouble click work on entire treeviewitem area not just on text?

I have a TreeView and i use an ItemTemplate for the Item Bindings similar to this: <TreeView ItemsSource="{Binding TreeViewItemCollection}"> <TreeView.ItemTemplate> <...
0
votes
3answers
72 views

Showing Message for loading WPF

I have a WPF application that connects and disconnects to WiFi. It takes around 2 seconds to complete the process. During that time, I want to show a simple waiting message on the top of my current ...