Getting data from an object owned by another thread
I have a process that takes quite a long time, so I'd like to run it in the background, not on the UI thread. The process involves rendering the text from a text block that exists on a canvas to...
View ArticleCustom sorting Datagrid
I have a Datagrid which has only one column and I want applying a custom sort on it. Currently, When I search the word "Clark", Datagrid displays filtered result as this:DavidClarkClarkDavidBut I want...
View Articlecall method/function from a button click event not working
I have this collection as seen in the code below and I am trying to execute the InserData function to insert the data form the collection to my SQL DB table in the Button_Click_1 event and cannot make...
View ArticleChange images within one image box on a timer?
Hi. I'm very new to developing. I am attempting to self learn. I am currently working on a project for my kids using Visual Studio 2019 using WPF app in C#. I have an image box that I want to use...
View ArticleWhy does the resource dictionary defined Height member not act in the...
A WPF UserControl has been defined. Because this control is used in a dozen places over many UserControls and there are many attributes to be set a ResourceDictionary file was defined. One of the...
View ArticleCustom TreeViewItem?
I'm thinking about creating a custom TreeViewItem (or at least just extending TreeViewItem to implement some custom properties). I want to add a checkbox and counter labels etc - my question is...
View ArticleHow can I force the ObservableCollection to notify change when a property of...
How can I force the ObservableCollection to notify change when a property of an item changes....I have a datagrid thats bound to an ObservableCollection.. ObservableCollection<SomeClass> a = new...
View ArticleGet Index of Item in ObservableCollection not working
Need to get Index of Item in ObservableCollection not workingI just Need Index in ObservableCollection<T>.
View ArticleDisplaying PrintDocument dialog at center position
Hi,I have a WPF application which includes printing feature.After clicking "OK" from print dialog, below dialog is displayedProblem statement: Above dialog is always displayed at Top Left corner...
View ArticleMouseWheel Scrolling on content of DataGrid does not work when loading as...
Hi AllAm trying to load the MS DataGrid inside ItemsControl as one of the item. In this scenario, am facing an issue like on scrolling the ScrollBar using MouseWheel, the content of MSDatagrid get...
View ArticleHow to solve error - System.InvalidOperationException: 'The calling thread...
HI,I am facing error with the wpf application that I am working on, basically I would need the colour of the ellipse to change if the string contains OFF, please see my code. I do not understand this...
View ArticleHow to automatically put the focus on a WPF WebBrowser object in design mode
Hi, I'm trying to write a simple HTML editor. As a test project, the application is very simple. It hosts a single WebBrowser control in a grid. <Window x:Class="WebBrowser.Window1"...
View ArticleWPF Topmost doesn't work as expected.
Hi,I have two Topmost app, if I run it 20 times, it might fails 1-2 times. I don't know why it doesn't work?Have you encountered with this experience before? .NET 4.0Title="OnScreen" WindowStyle="None"...
View ArticleDesigner Output DIfferent Then Running Application
I'm having an issue where the designer shows my application as it's intended to look, but when the application is running it displays with stuff cut off depending how I set it up. Current setup I'll...
View ArticleTrigger Binding to Child Control Not Working
I have this on a WPF Window<local:TestControl><local:TestHost /></local:MediaPlayer> Classes defined like thispublic class TestControl : ContentControl { static TestControl() {...
View ArticleSorted ObservableCollection using a Binary Search
Hi, I nneded to use an Obverable collection that stays sorted. I know we can do this by overriding the InsertItem, and to make the search quickest possible, I wanted to use a binary search.I have the...
View ArticlePartialy mixed up displayed content of DocumentViewer after loading different...
Hi everybody! If DocumentViewer (WPF Control) displays XPS file first time after the launch of my app, everything is OK! But if DV loaded another file with the SAME NAME as the previous file, the...
View ArticleHow to load an image form app resources?
My application folder looks like itI try to set the icon of mainwindow to this imagevar x = new Uri("Images/editor-icon-5.png"); Icon = new BitmapImage(x);but , when the progrom started I get this...
View ArticleWindowsFormsHost and AllowsTransparency makes all win32 controls transparent
If I set AllowsTransparency=True on a form, all of my WindowsFormsHost controls become invisible. These controls obviously don't have an opacity property, it there anything I can do to get these...
View ArticleExpression Blend Custom Item Template
I want to use a create a custom template VIA the Expression Blend interface (that is, not by manual typing in of stuff).I saw this done, a few months back. I forgot how...A class was created (ie...
View Article