wpf

Environment.CurrentDirectory is yielding unexpected results when running installed app

Background: I built an installer for my app, and all my dll's and content files are getting correctly copied to the C:\Program Files\MyCompany\MyApp directory. When I run my app from Visual Studio, everything works great. When I run the installed version of my app, however, I get a DirectoryNotFoundException. The problem seems to be wit...

wpf: how to make ComboBoxItems hold integers in xaml

ok, I must be having a brain freeze here... I have a ComboBox with 6 items and I'm trying to bind the selected item to an integer value. Its not working, I suspect its because the ComboBoxItem's are strings. I don't feel like making a list in code behind just to fill this little box, so is there a way in xaml to tell the comboboxitems t...

Get drag & drop to work in WPF which already works in Windows Forms

I am trying to use this function from a COM API which enables the window to receive drops (as in drag & dop) from another application. It is pretty straightforward in Windows Forms and works: public void EnableDropSupport(System.Windows.Forms.Form form) { IntPtr hwnd = form.Handle; _comAPI.RegisterDropWindow((int)hwnd); } But I...

Hosting a flash app in a WindowsFormsHost in a Surface application and .CallFunction

I'm working on adding a Flash app to a Surface application. It looks to be working just fine (overlaying the Flash app with an almost transparent Surface window to catch the Contacts). However, if I want to call a Flash function in my SWF (using .CallFunction), I get a E_FAIL exception. It is suggested that a callback function in the SW...

WPF TriState Checkbox - how to change the order of the states

I have a CheckBox in my application that is using the TriState mode. The normal behavior for this mode seems to be cycling between null, false, true. I'd like to change this behavior so that it cycles between null, true, false. What's the best way to do this? I've tried adding a click handler similar to this: void cb_Click(object se...

Are there any websites that collect WPF/XAML Templates/Styles of common controls?

Just writing another TabControl ControlTemplate and wondering if there are good websites for Wpf Styles/Templates. ...

WPF User control or Template? How would i create a Template using Blend?

Hi, How would i create a window template using Blend? My application will be sharing many pages with the same layout. One of my major concerns is what will happen when i need to make a change to the template. Will this update all of the pages automatically? Should i just use a usercontrol and add it to everypage? ...

How to mapping richtextbox size with papersize?

I have created WPF RichTextBox and ComboBox, I want to set size of RichTextBox mapping with paper size set at ComboBox which contain value such as A4, Letter, etc. How to do that? ...

Multiple inheritance problem in C#

Hi I am in a situation where i need to use multiple inheritance in C# with WPF. I am making a control lets say Control-1 that is derived from combobox control. I added some dependency properties as well as methods to the my control Control-1 class. Most of the properties and methods(infact the same implementation of properties and met...

how to make a simple xps file in wpf

Hey Guys, I want to make a simple xps file in wpf please tell me the whole code and step by step process as i am new in WPF. ...

Set focus on textbox in WPF

How to set the focus on an TextBox element in WPF I have this code: txtCompanyID.Focusable = true; txtCompanyID.Focus(); ...but it is not working. Any idea? ...

WPF TexBlock in Grid in ListView not Sizing Correctly?

I have a TextBlock that is in a Grid that is an ItemTemplate for a ListView. I have the items so that they grow when the window is resized, but I cannot figure out how to have the TextBlock be limited to that size. I've tried to do this with the width on the ColumnDefinition - if I set the Width to a fixed number (say 350) the text wra...

WPF ListView on portable device - extremely slow scrolling

I have a GridView in a ListView contained in a ScrollViewer element. I understand WPF draws only the visible data at runtime, for example on scrolling grids only the visible rows are drawn initially - my problem is that I don't have as much power as on the desktop on a portable device I am developing for, so my WPF ListView - which scr...

Why does the WPF Databinding not update after the collection is Filtered?

Why does my WPF ContextMenu databinding not update as expected when the collection is updated, however the ItemTemplate is displaying the context menu text correctly? Within the code below this works when I don't try update the ObservableCollection. When the underlying ObservableCollection is updated the DataTemplate updates without pr...

WPF DataGridCheckBoxColumn custom style?

Is there any way to style the checkbox in there? iv tried to define a style for the checkbox but that didn't work. after using mole it seems like the checkbox control does not have a ToggleButton in it it uses a BulleDecorator instead, im not sure of this first time im using mole.. What i want to achieve is that instead of a check box ...

DataContext name of WPFToolkit DataGrid shows in columns header background

Hi, I've got a strange problem with WPFToolkit DataGrid - after disabling AutoGenerateColumns, after adding only 1, narrow column, in the background of column headers appears full name of DataContext. It doesn't behave like a column - I can't neither resize or disable it. Previously I didn't know about this problem, because I had few w...

WinForms or WPF or Qt for Windows GUI with C/C++ as backend

I am to develop an application on windows. I have never done that before ;-) I need to do some heavy audio calculation, which has to be written in C/C++. This part will be a room correction algorithm which currently takes about 10 seconds per channel to run in Matlab. It has to be written in C/C++, since it might be ported to a DSP late...

I have to display a list of tracks GROUPED BY Album in WPF

Now I am aware that I probably need to use a ListBox and can use the GroupStyle stuff which completely 100% fits my needs. Only thing is that I've been told that: "Whenever a "GroupStyle" is set on the control, the panel that layouts the items changes from VirtualizingStackPanel to StackPanel (this is a hack in MS code)..." I will nee...

Rendering WPF DrawingGroup to single ImageSource

Currently I'm using a System.Windows.Media.DrawingGroup to store some tiled images (ImageDrawing) inside the Children-DrawingCollection property. Well the problem is now, this method gets really slow if you display the entire DrawingGroup in an Image control, because my DrawingGroup can contain hundreds or even thousands of small images ...

Validation in textbox in WPF

Hi, I am currently working on a WPF application where I would like to have textbox that can only have numeric entries in it. I know that I can validate the content of it when I lost the focus and block the content from being numeri, but in other Windows Form application, we use to totally block any input except numerical from being wri...