wpf

Key strokes in wpf window hosted in MFC ActiveX running in Internet Explorer

We have an MFC ActiveX control created in Visual Studio 2008 with CLR support which creates a WPF grid and shows a WPF window within that grid. This ActiveX is hosted within Internet Explorer and it shows up and works nicely except that the tab key, backspace, function keys etc. does not work since they are handeled by IE instead of th...

Displaying html from string in WPF WebBrowser control

My data context object contains a string property that returns html that I need to display in WebBrowser control; I can't find any properties of WebBrowser to bind it to. Any ideas? Thanks! ...

Data Binding : Child accessing AncestorType property

Bellow is the code behind and the Xaml for a demo app to review databing and wpf. The problem is binding Store.ImagePath property to the person node is not working. That is the image is not showing. Here is the code-behing namespace TreeViewDemo { /// /// Interaction logic for MainWindow.xaml /// public partial cla...

Multiple Input From Keyboard C# WPF

I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt ...

TemplateBinding with Converter - what is wrong?

I'm creating a game desk. I wanted to specify field size (one field is a square) as a attached property and with this data set value of ViewPort which would draw 2x2 matrix (and tile mode would do the rest of game desk). I'm quite at loss what is wrong because the binding doesn't work. Testing line in XAML for the behaviour I would lik...

Easiest way to get raw video/audio frames into an AVI (or other container)?

I'm working on writing a small application using the WPF MediaKit, and I would like to record some video - my plan is, to store the last n seconds as raw audio/video frames, then write them out as an AVI when the user requests it. Is there an easy way to actually pipe the data I've gathered from the Webcam into an AVI file? The trick i...

How can/could/might you bind WPF DataGrid to a List of objects each with some values in a Dictionary<string,string>?

major edit of a tumbleweed, may remain a tumbleweed... If I have a list of Customers and the data for each Customer is contained in a Dictionary how can I bind the list to the DataGrid so that each string key is a column? Edit: N.B. I know it's not a nice way to design a Customer class. e.g. public class Customer{ public int Id...

Why is generated XAML spitting out namespaces that are not asked for?

I have a very simple XAML form, that has one namespace definition. For some reason, when Visual Studio processes that XAML file in to it's component .g.cs, it's sticking a bunch of namespace definitions at the top that I have not asked for in the XAML, or the code behind, and they are namespaces that no longer exist in my project. Thus t...

Predictive typing functionality in WPF

Predictive typing is a handy feature on many mobile phones. How would/can you implement predictive typing in WPF? ...

wpf: getting combobox value

I have a WPF ComboBox named cbFileSize. I try to get is selected value like so: string tmp = cbFileSize.SelectedValue.ToString(); MessageBox.Show(tmp); But tmp gets set to "System.Windows.Control.ComboBoxItem: 16". Which function should I use to just get the value "16"? ...

Having a heck of a time getting object property values into textboxes

I am new to the MVVM design pattern, and I am working on a project to automate shipping processes. The particular problem that I am having is I have a UserControl (my EditShipmentView) which when it loads, assigns it's ViewModel to its DataContext. The ViewModel is passed a recordID which it uses to pull the entity that represents a sh...

How to specify path for file from different project in WPF?

Hello, I've got two projects in WPF and one project is the main one and the second one is just for testing (it uses files of the main project - files are added via Project -> add -> Existing items... -> selected file -> add as link so that the file is only in the main project really). Folders with projects are these: C:\Work\...\Proj...

How to align WPF Expander control toggle button

Hi I was wondering is it possible to align the toggle button on a WPF expander control to the far right side? ...

WPF ViewModel Commands CanExecute issue

Hi all, I'm having some difficulty with Context Menu commands on my View Model. I'm implementing the ICommand interface for each command within the View Model, then creating a ContextMenu within the resources of the View (MainWindow), and using a CommandReference from the MVVMToolkit to access the current DataContext (ViewModel) Command...

UI Design Choices and How to Implement Them

I am making an application that is a dashboard/widget host. This is an app I will release online to kickstart a content based website I am making. I am using MEF to load the plugins and I have a ui Concept Idea like this: http://i42.tinypic.com/scb6nd.png Is this a good design choice? How would I implement the Navigation? 3. Is there ...

Need help understanding WPF MeasureOverride and ArrangeOverride infinity and 0 sizes

I'm trying to build a simple panel that contains one child and will snap it to nearest grid sizes. I'm having a hard time figuring out how to do this by overriding MeasureOverride and ArrangeOverride. Here's what I'm after: I want my panel to tell its owner that (a) it wants to be as large as possible, then (b) when it finds out what th...

How to design parts of the application in XAML and how to reusing it then?

I'm working on a main window in my application and I would like to design parts of my window separately in Visual Studio designer. Main window Game desk (actually more of them and therefore it would be nice to design the game desk, mark it as a resource and then just via simple code (something like creating a new object and setting ...

Inheritance of templates in WPF

I'm trying to make sure that every child of a given element (MPF.MWindow) gets custom templates. For instance, the button should get the template defined in resMButton.xaml. As of now I'm using the following code on: (resMWindow.xaml) <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

How do I launch a WPF app from command.com. I'm getting a FontCache error.

I know this is not ideal, but my constraint is that I have a legacy application written in Clipper. I want to launch a new, WinForms/WPF application from inside the application (to ease transition). This legacy application written in Clipper launches using: SwpRunCmd("C:\MyApp\MyBat.bat",0) The batch file contains something like thi...

WPF relaycommand from usercontrol

Hi, I'm new to WPF and in the spirit of trying to do things the correct way have tried to implement MVVM in my application. I've made use of the frequently mentioned article by Josh Smith, and apart from making me realise how little I know, it has left me a little stumped. Specifically, I have a page that uses the RelayCommand object t...