wpf

Unreasonable WPF DataGrid Loading Time

I've always had long loading times with WPF DataGrids, and I cannot find any similar reports online, so I suspected that I was doing something wrong. Now I am sure of it, since adding layout complexity considerably slows down execution. In a very simple layout, the DataGrid populates instantaenously, whereas the code below takes around...

How do Create Windows.Controls.Image Source with System.Windows.Media.Imaging.BitmapFrameDecode.

Hello Sir/Madam, I have created the BitmapSources using the following code. Assume iFrameCount is 10. for(int iIndex = 0; iIndex < iFrameCount; iIndex++) { //Reading Bytes this.BitmapSources.Add( BitmapSource.Create(iWidth, iHeight, dpi, dpi, PixelFormats.Rgb24, null, bytes, stride)); } And using(MemoryStream MemStream = ne...

How do I bind to different property on ComboBox SelectedItem?

I have a combobox in WPF like this: <ComboBox Text="Select Language..." IsEditable="True" IsReadOnly="True" ItemsSource="{Binding XPath=item/@name, Source={StaticResource Items}}" SelectedItem="{Binding Path=Test, Mode=OneWayToSource}"/> Where Items is: <XmlDataProvider x:Key="Items" Source="/itemlist.xml" XPath="...

Display captured Jpeg File

I'm able to save the captured image from a barcode scanner using this code: Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); dlg.DefaultExt = ".jpg"; dlg.Filter = "JPEG Images (.jpg)|*.jpg|All files (*.*)|*.*"; if (dlg.ShowDialog() == true) { using (FileStream...

WPF: Databinding with DataGridComboBoxColumn

This is what I want: There is a combo-box column bound to the ApplicationKey property of ClassA The combo-box is populated with ApplicationTokens from a static function all. An ApplicationToken has a ApplicationName and ApplicationKey property When an item is selected in the drop-down, the ClassA.ApplicationKey property is set to the A...

Developing WPF App to Run on Windows XP Embedded Monitor

I'm experienced developing Windows client desktop apps with WPF, but I've never developed apps for a Windows XP embedded device. We have monitors located around the factory that run XP embedded and I would like to know if there are any issues developing a WPF application to run on the XP embedded monitor. For instance, what are some of...

WPF: "None" option when Databinding with DataGridComboBoxColumn

This is what I want: There is a combo-box column bound to the ApplicationKey property of ClassA. ClassA.ApplicationKey is a Nullable<Int32> The combo-box is populated with ApplicationTokens from a static function all. An ApplicationToken has a ApplicationName and ApplicationKey property When an item is selected in the drop-down, the Cl...

Windows Font Size screws up WPF application

Hello, we're having this weird bug where if the application is opened and the user changes the windows font size here: When the font size is changed to extra large, one of our controls DataContext is changed to null, and it's DataContextChanged event is called too. I set a breakpoint there and checked the callstack and this is part of...

Direct Routed Event question

A colleague and I were chatting about routed events, and we came up with some things that didn't make a lot of sense. Primarily, what is the purpose of a Direct event, and why are both LeftMouseButtonDown and PreviewLeftMouseButtonDown direct events as opposed to bubbling and tunneling respectively? According to the documentation, the ...

Wrapping text around an image or linking two TextBlocks in C# WPF

Hi, I am creating a program that shows text and an image in the same window. The Image is in the top-left corner of the screen and the Text will begin to the right of it, and then continue down below the image. Currently, what I am trying is to take two TextBlocks (one to the right of the image and one below both the image and the firs...

WPF Routed Command with Bindings per-Tab

I intended to disable and enable the Buttons outside the TabControl, just like those inside the TabItem when the current tab is changed. But the CommandBindings of the TabItem do not seem to impact "up" the visual tree. What is the right way to do this? With this XAML: <Window x:Class="WpfApplication10.MainWindow" xmlns="http://sch...

WPF: Is there a way to directly get the Window object a control is on?

Is there a way to directly get the Window object a control is on? ...

WPF: Is there a "BeforeSelectionChanged" event for the combobox?

Is there a "BeforeSelectionChanged" event for the combobox? I want to verify some stuff before the SelectedItem property changes. ...

WPF textblock display requirement

I have to fulfill below requirement for my display text (assume I am using TextBlock) Draw white text (8pt 255-255-255 with 0 thickness stroke) over a dark filled text (8pt 69-77-96 with Thickness 5) How should I implement this? I am flexible to use other controls also.. Appreciate your help!! ...

Create a continuing line graph in C#, WPF

Hi everyone, I am showing the user data on their network speeds in C# but I also want to show it plotted on a graph every second or so to show the high's and low's. Does anyone know how to do this, sorry if I haven't made myself clear. Thanks ...

C# WPF OnPaint method alternative?

In C# WinForms whenever making a small game here or there, I would write up a quick class that was a subclass to System.Windows.Forms.Panel and in the constructor, setting DoubleBuffered to true. Then you could override the OnPaint method to display game elements. I've done this for 2 or 3 years now, but I'm really trying to embrace WPF ...

credentials questions

Hi, Let me explain briefly how the app is being setup (by the previous architect).. I have the following app: Server1 Server2 WPF app which installed on the client desktop WCF app which hosted on IIS in Server1 SQL server instance which installed on Server2 (with internal IP addr 10.111.3.10) WPF on client side calls the WCF service...

Statistical usage of WPF / Winforms / ClickOnce / ...

I'm after some sort of statistic of usage of WPF in programming application. Is there any reference online or stats, such as the browser usage stats, for WPF vs Winforms, ClickOnce vs MSI, C# vs. VB, etc.? Also is there such thing per year? (ie. tracking the evolution in the usage of WPF) I've googled but no luck so far. Thanks. ...

How can I set ContentPropertyAttribute to a Content Presenter?

I have a Usercontrol: SnazzyForm, which in addition to a couple of borders and and a header area and whatnot, also has a Content Presenter which under .NET Framework 3.5 presented content passed to it in other forms that used the control just fine. However after moving the project to 4.0 I am greeted with "Cannot add content to object o...

WFP app - recommended approach for persisting this type of data...

What would you recommended re an approach to persist data for the following situation: WPF application (desktop) Will be capturing information ever second (approx) and will need to store about 5 values per second effectively. Will need to save data for up to say 1 month Usage will be both (a) real time viewing of last few hours data, +...