24,023 questions with .NET-related tags

Sort by: Updated
1 answer

events in custom control in wpf

I've made this user control and it works well, I'm trying to covert it to a Custom Control, but I can't hook up my handler to those 3 events. any help will be appreciated. <Canvas x:Class="SMFU.UserControls.Public.MovableChildCanvas" …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-11T16:58:09.337+00:00
essamce 621 Reputation points
commented 2020-06-16T07:29:58.127+00:00
DaisyTian-1203 11,616 Reputation points
3 answers

Clarify INotifyCollectionChanged

I have a TreeView bound to an ObservableCollection with a ViewModel. The TreeView includes folder-like elements that will have child items. Most times opening the app we won't need to view those child items so I'm not filling them in when the app opens,…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-11T12:01:25.887+00:00
Ken Krugh 116 Reputation points
commented 2020-06-16T05:20:16.797+00:00
Peter Fleischer (former MVP) 19,231 Reputation points
1 answer

Memory leak. Class with finalizer

Created a minimal reproducing application. Reproducing conditions: Visual Studio 2017 WPF application Launch the application under the debugger WPF window code (class with finalizer, very busy WPF main thread): code: using…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-15T10:00:47.693+00:00
Igor Buchelnikov 1 Reputation point
commented 2020-06-15T14:17:58.28+00:00
Peter Fleischer (former MVP) 19,231 Reputation points
2 answers One of the answers was accepted by the question author.

WPF custom data grid with button

In WPF xaml, I would like to make a custom data grid with button in cell. I want to create button(Say "Add" button) in the last cell of each row as shown in below pic. While pressing "add" button some operation will happen…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-12T02:24:43.93+00:00
Arun Menon 21 Reputation points
accepted 2020-06-15T07:27:56.813+00:00
Arun Menon 21 Reputation points
6 answers One of the answers was accepted by the question author.

WPF BindingGroup Validation

I am using a StackPanel to host several TextBoxes that have validation rules attached. I also have a StackPanel.BindingGroup validation as follows: <StackPanel.BindingGroup> <BindingGroup Name="ValidateAllFields"…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-09T02:02:00.597+00:00
Allanjb 246 Reputation points
answered 2020-06-15T04:40:01.893+00:00
Peter Fleischer (former MVP) 19,231 Reputation points
0 answers

Cross Origin Requests not working in Web Browser control - C# - WPF

Hi, I have a Web Browser control in my WPF application and its source is set to an URL that will load few icons and images from different domain than the Origin. All cross domain requests are not working. How can I enable cross domain requests in Web…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-10T20:35:50.527+00:00
Manigandasuresh S 1 Reputation point
commented 2020-06-15T02:23:17.03+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

How to display 3 single channel array in wpf?

I have 3 IntPtr Pointers of Red, Green, and Blue channels. I need to display these pointers as an RGB image. I know the width and height of the image. If I convert it as a single pointer it takes processing cost. Here is my Conversion Code, public…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-12T10:31:41.967+00:00
Tamil Prakash S 1 Reputation point
answered 2020-06-14T15:41:43.49+00:00
Ken Tucker 5,846 Reputation points
1 answer

Custom Control edit template cause compilation failure in Visual Studio 2019 (version 16.7 Preview 2)

In Visual Studio 2019 version 16.7 Preview 2, while try to edit the template of my custom control using Edit Template option in designer which causes compilation failure due to empty properties fields generated. Please find the code genereate details. …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-11T03:03:40.413+00:00
Magesh Sankar 31 Reputation points
commented 2020-06-12T08:12:22.35+00:00
DaisyTian-1203 11,616 Reputation points
1 answer One of the answers was accepted by the question author.

TextBlock Right TextAligment Doesn't work inside a ScrollViewer

Hi, Im coding in XAML. Im trying to create a TextBlock inside a ScrollViewer with a Right Textaligment. but no matter what I put, when the text exceeds the width of the TextBlock, It always shows the text from the left to the right. Here is a piece…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-11T10:54:37.5+00:00
Miguel Cortés Rodríguez 21 Reputation points
commented 2020-06-12T07:35:07.767+00:00
Miguel Cortés Rodríguez 21 Reputation points
1 answer

WPF, XAML, Combobox: Cannot find source for binding with reference

I have some comboboxes that use the same possible input values. Hence I tried to create a style and then set the style on my combo boxes. However, I am getting the error System.Windows.Data Error: 4 : Cannot find source for binding with reference…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-12T06:23:47.837+00:00
hfaun 1 Reputation point
answered 2020-06-12T06:51:32.247+00:00
Peter Fleischer (former MVP) 19,231 Reputation points
0 answers

ColumnSpan in Grid is not working properly when MaxWidth is 0 in VisualStudio 2019 (Version - 16.4.5)

In my project created in VisualStudio 2019 with version 16.4.5, I have some columndefintions in grid and also uses columnspanning. But when I set maxwidth as 0 for some definition, the columndefinitions are not spanned to full width properly. Code…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-11T11:30:16.9+00:00
Shobika Palani 36 Reputation points
commented 2020-06-12T03:57:24.873+00:00
DaisyTian-1203 11,616 Reputation points
2 answers One of the answers was accepted by the question author.

WPF TextBox Controls - How Hidden touch keyboard in touch screen

When I click TextBox in touch screen, System auto Popup soft Keyboard, What should I do,Hidden popup keyboard? Thanks

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-09T03:54:17.097+00:00
929Free 281 Reputation points
accepted 2020-06-11T06:31:09.923+00:00
929Free 281 Reputation points
1 answer

Setting an Expander toDatagrid programmatically

I'm creating a runtime expander and I want to add to my datagrid. Here's the code: // Creazione Expander var expGrid = new Expander { Name = "exp" }; var expStackPanel = new StackPanel { Name = "expStackPanel", Height = 30,…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-08T08:28:31.62+00:00
Alberto Sartori 1 Reputation point
answered 2020-06-09T03:52:36.11+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

WPF using sdk csproj with Desktop bridge

In preparation for converting my WPF app to .net core I changed the csproj to the sdk format. It compiles and run but the installer projects that create the package I use for side loading has an error specifying that my wpf project target net472. It…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-05T00:20:08.41+00:00
Avi Stokar 1 Reputation point
commented 2020-06-08T06:32:00.227+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

Need to restrict mouser hover effect on touch action

I have an custom calendar control, I have highlighted day cell on mouser over, I need to restrict the mouse hover color applied to day cell when perform touch action in calendar.Please provide any suggestions on this. c# wpf touch

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-04T18:13:01.827+00:00
Magesh Sankar 31 Reputation points
commented 2020-06-05T08:18:15.027+00:00
Magesh Sankar 31 Reputation points
1 answer

XamlWriter image serialization isssue (InvalidOperationException: Property 'UriSource' or property 'StreamSource' must be set.)

Hi, i am using a ink canvas and added a image to it and then serialize using XamlWriter. Image img = new Image(); BitmapImage img = NImageHelper.GetBitmapImageFromString(ImageData, new Size(src.Width, src.Height)); img.Source = img; string Xml =…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-03T11:03:49.647+00:00
Naveen Kumar R 1 Reputation point
answered 2020-06-04T06:58:53.383+00:00
DaisyTian-1203 11,616 Reputation points
0 answers

[WPF] Image get disappeared while zooming out image using DeltaManipulation event (pinching)

Hi All, My requirement is to do pinch zooming in WPF platform. For that, i have created simple POC sample according to my requirement and it can be reproduced. Please find the snippets below XAML: <Grid> <Image…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-02T06:50:11.17+00:00
Vignesh Ramesh 1 Reputation point
commented 2020-06-03T09:19:53.45+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

When I use WPF MediaElement loaded a https mp3 resource,and call Play(),error appeared

When I use WPF MediaElement loaded a https mp3 resource,and call Play(),error appeared (when load a http mp3 resource, nothing happened) test link: …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-03T01:38:24.963+00:00
Lakeside Knight 1 Reputation point
commented 2020-06-03T09:08:19.207+00:00
Lakeside Knight 1 Reputation point
1 answer

is there any touch event as like Mouse Wheel event

I have an custom items control , i need to scroll items control to certain distance based on touch scroll action. MouseWheel event continuous triggers based on mouse wheel distance value. I need same in Touch scroll, is there any event to do same like…

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-06-02T13:34:59.24+00:00
Magesh Sankar 31 Reputation points
answered 2020-06-03T03:00:37.853+00:00
DaisyTian-1203 11,616 Reputation points
1 answer

Dependency property not raising when value assinged in view model

Hai I am trying to create a custom datagrid control with a property called SelectedItem and I am trying to assign some object to this property in my viewmodel. My codes are Custom control public object SelectedItem { …

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
asked 2020-05-29T17:54:20.277+00:00
Babu R 81 Reputation points
answered 2020-06-02T12:02:20.867+00:00
Peter Fleischer (former MVP) 19,231 Reputation points