Questions tagged [wpf]

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

wpf
Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

wpf datagrid does not bubble the scrollwheel event [duplicate]

The scrollwheel does not work on a DataGrid inside a ScrollViewer, although the vertical scrollbar just works fine. I tested with this setup: <ScrollViewer> <StackPanel ...
Roland's user avatar
  • 4,874
0 votes
1 answer
32 views

RelayCommand (MVVM Toolkit) Simple Demo explaination

Hi stackoverflow community, I'm new to the MVVM topic but was able to get some of the basics down. I worked on a few tutorials and implemented my own RealyCommand and a ViewModelBase. I got my Buttons ...
macflirty's user avatar
0 votes
1 answer
50 views

C# WPF Menu no longer works after upgrade project to SDK style

Problem: The menu no longer works after an upgrade with the upgrade-assistant to SDK style Starting point: Project type: WPF App (.Net Framework) Default generated App.xaml Modified MainWindow.xaml: &...
Noe's user avatar
  • 9
0 votes
0 answers
27 views

Several rows highlighted when using AllLinesData.ItemContainerGenerator.ContainerFromItem

I have interesting issue about DataGridRow row = (DataGridRow)AllLinesData.ItemContainerGenerator.ContainerFromItem(AllLinesData.SelectedItem) (C#, WPF) I'm using this code to highlight one row from ...
Light Mirto's user avatar
0 votes
0 answers
152 views

How can I stop Excel from losing focus while embedded using SetParent?

I am trying to embed Excel inside a WPF application. I've got all the stuff I need working already, except that now I am trying to allow .xlsm files. When clicking on ActiveX controls, it seems like ...
Anthony Mattice's user avatar
0 votes
1 answer
44 views

Hello i have created 3 viewModels and want to connect them to a single View(UI) but can't

I have 3 viewModels (AdminViewModel, StudentViewModel, ProfessorViewModel) i have a UI where a user logs into a database,I have made a method called ExtractRole which takes the role of the user that ...
Dodo's user avatar
  • 1
0 votes
1 answer
24 views

WPF: ControlTemplate of ToggleButton will cause App to crash when binding "IsChecked" property

Edit: to reproduce this bug, you have to put the ToggleButton inside a 'non-first' TabItem of a `TabControl' :], like this: <TabControl> <TabItem> <Label>Test</Label&...
Nowayout's user avatar
  • 315
0 votes
0 answers
30 views

How to make a wpf usercontrol with events(with Microsoft.Xaml.Behaviours.Wpf command) and dependecy properties? [duplicate]

I want to make a UserControl that has his own custom event and custom DependencyProperty I have this code that works fine: UserControl1.xaml.cs: public partial class UserControl1 : UserControl { //...
Quikler's user avatar
  • 19
0 votes
1 answer
48 views

Disable "Print" button in "DocumentViewer"

I would like to disable the button in question. My code is: <DocumentViewer x:Name="viewerDocument" Document="{Binding GeneratedDocument}" /> and the ...
Fabrizio Ciavatta's user avatar
0 votes
0 answers
19 views

Is it possible to package a WPF app in MSIX format and run OAuth2?

We have a WPF app that uses OAuth2 to authenticate the user. We are looking at supporting a MSIX installer but our current OAuth2 flow doesn't work when packaged in MSIX format. I have been able to ...
dransom90's user avatar
  • 1,620
0 votes
0 answers
48 views

Connecting to local network from inside my own app

I have this wpf app, that should later be something like a kiosk... Now in my settings page I have the WiFi settings. I have managed to display all local networks and I can connect and disconnect from ...
elzin kalabic's user avatar
0 votes
0 answers
34 views

INotifyDataErrorInfo - Red border doesn't disappear when error is cleared

Please check below a simple project reproducing the issue. The issue is that the red border (meaning there is an error) remains on my control even though error is cleared. In a WPF app, I have a "...
Nicolas's user avatar
  • 19
0 votes
0 answers
41 views

Can I use the Narrator Natural Voices added in Windows 11 in System.Speech.Synthesis?

I want to add TTS in WPF through the SpeechSynthesizer provided by System.Speech.Synthesis. But, the natural voices added in Windows 11 are not newly added even though more voice additions are ...
Lee's user avatar
  • 1
0 votes
0 answers
42 views

Drag and Drop feature in WPF

As you can see, there is a drag feature here. Everything is working perfectly, but when I drag TrainLeft or TrainRight, I can only see them inside the ScrollView while I am moving them. I want to see ...
Akmal Bukhariev's user avatar
0 votes
0 answers
18 views

Implement Elastic APM for WPF application

I'm having trouble implementing APM into my WPF app. I got the code below from elastic website but I got error Startup not found: https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-dotnet-...
May Nguyen's user avatar
0 votes
1 answer
21 views

Why is the DataContext on my View Null in a Custom RegionBehavior using Prism?

I am using Prism for WPF, and I am having an issue disposing view models in a TabControl when the tab is closed. This is leading to a memory leak. I have IDisposable in my view and view models (VM) to ...
juicebyjustin's user avatar
0 votes
0 answers
46 views

'Alignment' Tags being added whenever I move a rectangle in C# WPF

I am currently learning how to create a WPF app in C# Visual Studio 2022 and an issue arose which I couldn't find a fix for online. I am following this tutorial https://www.youtube.com/watch?v=...
CriticalCloud's user avatar
0 votes
0 answers
37 views

WPF Create a reuseable UserControl that binds to ObservableCollection<float> [duplicate]

I am trying to creare a reusable UserControl that can edit an ObservableCollection this what i got: The problem is the values insdie the array wont update from the UI, or from the property (code). i ...
Daniel Bublil's user avatar
0 votes
2 answers
48 views

WPF custom control path,clickable background

I would like to create a button or something with the following form/path: Picture of the issue <Grid Background="red"> <Path x:Name="pathSilo" ...
Lionhart's user avatar
0 votes
2 answers
47 views

Switch the whole style of my app from my custom styles to default materialDesignStyles

I am looking for way to swap the whole wpf app style from my custom styles to default materialDesign styles and at runtime if possible.Help would be much needed.Thank you I tried this but it's not ...
Othmane Ouazzani's user avatar
0 votes
1 answer
62 views

A few formatting questions regarding WPF LiveCharts HeatSeries

I used LiveCharts' HeatSeries control to create a climate chart in my WPF application (using MVVM / Caliburn.Micro). The chart is populated in my ViewModel which is working as intended but I'm having ...
GasPanic's user avatar
0 votes
1 answer
60 views

C# Wpf : how do i set a background color of items in an menu item

I want to set the background color of the menu items in a menu item like this: I have a style for my context menu but it apparently doesn't change the colors for that. I've tried changing the menu ...
VindE's user avatar
  • 3
0 votes
0 answers
62 views

Powershell, Mahapps : error Uunknown type '{clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro}MetroWindow'

I've spent many hours, googling and trying, but I'm still spinning around with this error : Unable to create unknown type '{clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro}MetroWindow' I'...
OscarDelta59's user avatar
0 votes
0 answers
22 views

wpf scrollintoview high cpu and freezing

i have one problem. using scrollintoview, select item in datagrid.(item count is about 100) alomost is fine, but sometimes high cpu about 29%.... so i try this... ScrollViewer.CanContentScroll="...
user23623430's user avatar
0 votes
0 answers
40 views

Issues with XamlWriter

I've some issues with XamlWriter. I've a button with a TextOptions: <Button FontFamily="Calibri" FontSize="67" FontWeight="SemiBold" Tag="K -" Margin="1,...
user23617663's user avatar
0 votes
1 answer
49 views

How to Cancel ToggleButton Animation on Window Switch

I use this ToggleButton for my SettingsWindow. When i switch over to my SettingsWindow i can see the Animation of Every ToggleButton that is in the ON State. I want them to be fully enabled already ...
user834874378's user avatar
0 votes
2 answers
47 views

how to get selected info in wrappanel in WPF?

First, let's look at a piece of code like this: <Window x:Class="WpfTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="...
J. hlz's user avatar
  • 5
0 votes
0 answers
21 views

Send data from WPF to Flutter

There is this code on WPF in which I first receive data from Flutter and there is also where it is being sent. I get the data from Flutter perfectly private async Task ShowInitialWindowStateAsync() { ...
Noukin's user avatar
  • 1
0 votes
0 answers
21 views

Issue with RadPane content Freezing After Resetting Layout on Floating State

My application utilizes the RadDocking control to manage layout, including a RadPane that hosts a CefSharp browser. I've observed that when this pane is docked and I reset the layout, everything ...
OrLevi's user avatar
  • 62
0 votes
1 answer
63 views

DataGrid rows not able to display different values in WPF

I want to create a DataGrid in my WPF Application which has 2 rows, and 14 columns. I have defined a method which creates this data-grid during runtime. The issue that I'm facing is that both the rows ...
SEIL's user avatar
  • 3
0 votes
0 answers
94 views

Why is WPF design-time data out-of-date?

I am using Visual Studio 2022 (17.9.3) and have created a .NET Framework 4.8 library project containing controls with MVVM databinding to viewmodels following a pattern like this: <UserControl x:...
C Robinson's user avatar
0 votes
1 answer
43 views

Get printer trays and paperSource by selected printerName

I am having a ListBox where I show all the printer I can find on the windows client. List<MyPrinterClass> lstPrinters = new List<MyPrinterClass>(); foreach (var item in PrinterSettings....
Philipp's user avatar
0 votes
0 answers
15 views

PowerShell MetroWindow Image [duplicate]

Hi i atually create a gui apps WPF with mahapps metro and when i try to put a general background for my gui apps that not working and i need to put the entire path : Not WORK ( i use Pack URI for ...
Ynot's user avatar
  • 1
0 votes
1 answer
29 views

Returning x pages from a Word document and creating a new document with them

Here is the plan - it's a good plan, but there is the proverbial brick wall. I have Word documents stored as Byte() on a database - I need to pull selected ones and save to a temp directory as word ...
gchq's user avatar
  • 1,680
0 votes
1 answer
54 views

Update a dynamically created DataGrid in WPF

I'm developing a WPF application and have created two data-grids as shown in the attached image. The second data-grid is being created dynamically using a CreateCoachCompositionDataGrid() method. ...
SEIL's user avatar
  • 3
0 votes
0 answers
28 views

Programmatically setting viewbox child [duplicate]

I have a load of vector images which I have mocked up in inkscape and then imported into my project as canvases within resource dictionaries. When designing my form I show them like this: <Viewbox ...
RPM's user avatar
  • 1,726
0 votes
2 answers
52 views

Add hover effect on dynamically created button in WPF c#

I am still new to Windows App development. I'm trying to create a button dynamically, and I don't know how to remove the default background color on hover and add a custom background color instead. In ...
KANAYO AUGUSTIN UG's user avatar
0 votes
0 answers
31 views

What is the correct approach to implement Card drag in Wpf?

I am currently developing a card game in WPF and using MVVM pattern to build connection between View and Model. The task would be to move a card by mouse click and hold. The cards are dynamically ...
bazsisz's user avatar
  • 394
0 votes
0 answers
29 views

Nested list binding in dataGrid

I am looking for a solution to bind nested list to DataGrid to display them in separate columns. ViewModel public class ParametersDataGridViewModel : ViewModelBase { public ObservableCollection<Row&...
aret's user avatar
  • 9
0 votes
0 answers
22 views

How can I implement touch scroll animations like iphone in WPF?"

I have implemented a paging list like this View <Window x:Class="TouchScrollTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...
Sadiya's user avatar
  • 1
0 votes
2 answers
42 views

Add Icon on WPF

I'm building a WPF Project with .Net WPF Framework 4.7.2. I'm trying to use MaterialDesign library so I have this App.xaml file: <Application x:Class="DesfireCodificatoreWPF.App" ...
Francesco Vargas's user avatar
0 votes
0 answers
7 views

How can I make the MediaElement not cutting off my bottom grid?

to keep it short. I am developing a very simple video editor and I am currently still trying to structure the controls/panels etc. I want everything to resize dynamically but once a video is loaded ...
VeryImportantName1337's user avatar
0 votes
0 answers
43 views

WPF Change The Visual Template of Specific DataGrid Cells

I need your help about my issue with datagrid in WPF. In the screenshot below, those highlighted in green, I want to split the cell content into 2. Basically, I would use stackpanel with two ...
Lorna Watawat's user avatar
0 votes
0 answers
25 views

Columns are not displayed

i'm new on live charts and maybe this is a stupid mistake but for now i don't understand why my columns are not displayed on my charts. i have tried but seems that the binding not work correktly. But ...
Giacomo Michele Di Marzio's user avatar
0 votes
0 answers
9 views

WPF Combo box custom template for mouseover main button not dropdown items, styled in the combobox itself

I have combobox items styled the way I want them, but I am stuck getting the main button itself styled the same way. Is there an efficient way of adding my existing styling to the main combobox button ...
PlayLORD-SysOp's user avatar
0 votes
0 answers
24 views

I am using MahApps hamburger menu along with right window command buttons. How can I change content control of hamburger menu from command buttons?

I am building a C# WPF application with MahApps hamburger menu and right window commands (RWC) to navigate between different views. I am able to get the hamburger menu items to switch views associated ...
Dinesh Ayyala's user avatar
0 votes
0 answers
28 views

How to write unit test for Application.Current.Dispatcher.BeginInvoke

I have a custom wpfmessagebox that has to be invoked from the dispatcher. It displays properly when running however I'm having trouble writing a unit test for it. The test can run but the "cVM....
OmniStack's user avatar
0 votes
1 answer
33 views

Menuitem item style

I have a context menu with the following items <ContextMenu x:Name="NotificoContextMenu" x:Shared="false" x:Key="SysTrayMenu" x:FieldModifier="public" ...
VindE's user avatar
  • 3
0 votes
0 answers
31 views

WPF How to show a MemoryStream PDF document to a WebBrowser

I cant show a pdf document save it in a database table direcly to a WebBrowser using a MemoryStream. I have a DataBase with pfd documents saved in a table filed, and I want to show the pdf document ...
Francisco Lopez's user avatar
0 votes
1 answer
24 views

Default Context Menu change only colors

I have this problem I set up style for my wpf window and part of it is used in default ContextMenu but there still are part of default style. I try to just set up background for every type of controls ...
Mikołaj Frankiewicz's user avatar