wpf

Why does this C# event handler not respond to this event?

The following code is a silverlight application but the same happens in WPF, so it seems to be just something I'm missing regarding the delegate, event, etc. Can anyone tell me why the following code successfully executes this event: OnLoadingComplete(this, null); but never executes this event handler? void initialDataLoader_OnLoadi...

Javascript resizing with window.open and WebBrowser control

I'm using WPF WebBrowser control and handling NewWindow3 events using following code: IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document; Guid serviceGuid = SID_SWebBrowserApp; Guid iid = typeof(SHDocVw.WebBrowser).GUID; SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref i...

Windows: Does something temporarily grab the com ports on startup?

I have a WPF/C# app that is launched as part of the "Startup" group on a Windows Embedded Standard machine. One of the first things the app does (in its static App() method) is create a new SerialPort object for COM1. COM1 is a hardwired serial port, not a USB virtual port or anything like that. My problem is that every so often (maybe ...

WPF DataGrid AutoColumn generation via ICustomTypeDescriptor.

In a test project I've managed to AutoGenerate WPF DataGrid columns in the following scenario, where the data is stored in a Dictionary and binding is performed via PropertyDescriptors: public class People:List<Person>{ ... } public class Person:Dictionary<string,string>,INotifyPropertyChanged,ICustomTypeDescriptor { } The probl...

InlineUIControl

Hi. I have a project in wich I must create a form editor (just like infopath) using wpf. For this I thought to use a RichTextBox and in there I would place InlineUIElements with the different controls (TextBox, ComboBox, etc.). The problem is that I can't change some properties associated with those controls. Here's some XAML: <RichTex...

WPF Remove Extra Space on bottom of ListBox

Hello all, I am getting a large amount of space under my custom listbox if I add an item with multiple lines of text. What can I do to solve this? My code <!-- List Item Hover --> <LinearGradientBrush x:Key="MouseOverFocusStyle" StartPoint="0,0" EndPoint="0,1"> ...

WPF Application Maximize Problem

How to set the Height and width of a WPF application on maximise? Problem I face is because of variable height of the windows taskbar in different computers Presently, I am doing it like this. Please suggest any better technique if (this.WindowState == WindowState.Maximized) { this.Height = primaryScreenHeig...

How to avoid coupling when using regions in Composite WPF

I have an application designed using Microsoft's Composite Application Library. My shell has several regions defined so that I can inject content from separate modules. I'm looking for a design pattern that will reduce the coupling that these regions introduce. In all examples I have seen, regions are defined and accessed using a string...

Using Visual Studio 2010 Express to create a surface I can draw to

I'm coming from a Java background and trying to port a simple version of Conway's Game of Life that I wrote to C# in order to learn the language. In Java, I drew my output by inheriting from JComponent and overriding paint(). My new canvas class then had an instance of the simulation's backend which it could read/manipulate. I was then...

How can I sort a DataGridTemplateColumn on a WPF Toolkit DataGrid?

I have a WPF Toolkit DataGrid with one DataGridTemplateColumn. I've specified in a grid attribute that I wish all columns to be sortable, but the DataGridTemplateColumn won't allow it. All other columns do allow sorting. I've even tried explicitly setting CanUserSort to true for that column, but no luck. Is it even possible to sort a tem...

WPF or Silverlight Learning Resources for Business Applications

I am the only developer at a non-profit organization(~200 employees) where we are a M$ shop and 90% of the things I develop are specific to our company and are internal only. I am given a lot of latitude on how I accomplish my goals so using new technologies is in my best interest. So far I have developed all winform & asp.net applic...

What WPF frameworks should I use?

I'm a newbie to WPF and I'm developing a brand new windows desktop application and I would like your opinion on what WPF framework I should use. I know this question has been asked before, but the last question was asked at least several months ago. A lot has changed since then. Right now, I'm using MVVM Light which is more of a lib...

how to get the control added at the specified row and column in window control Grid?

how to get the control added at the specified row and column in window control Grid(not gridview or datagrid)? in C# Suppose we know which row and column the control is located, how to get the control by grid row and column? Thanks ...

WPF 3D - Need help writing conversion methods between 2D and 3D (Point3DToPoint and PointAndZToPoint3D)

I'm new to WPF 3D, so I may just be missing something obvious, but how do I convert from 3D to 2D and (for a given z location) from 2D to 3D? Specifically, I need two conversion methods: Point3DToPoint - If I have an (x, y, z) coordinate in the 3D world, how do I determine the (x, y) coordinate on the projected 2D surface. Method sign...

Problem Binding to a Brush Property in WPF

Working in WPF, writing a custom user control. I am trying to change the background property of the Border element when I change the value of a property of the class. Right now I am working on simply binding it to a DP, though if there is a better way I am open to suggestions. Here is the XAML for the UserControl <UserControl x:Class="...

WPF: Selecting the Target of an Animation

I am trying to create a simple (I think) animation effect based on a property change in my ViewModel. I would like the target to be a specific textblock in the control template of a custom control, which inherits from Window. From the article examples I've seen, a DataTrigger is the easiest way to accomplish this. It appears that Windo...

Track changes in Property Changed

Hi, I want to filter my observable collection of viewmodel objects to the objects that are updated. I have subscribed to the Property Changed event for each viewmodel. But I am not sure how shall I track the objects so the end result would be only the objects that are updated in the UI. ProgramViewModel Cur=new ProgramViewModel(pr...

Have a clickable button on top of a combobox in WPF

I can get a button to appear and be clickable in the drop down list of a combo box, but I cannot get the selected combo box item (the drop list is closed) to have the button be clickable. It always skips the button click and just opens the drop down list. I basically want the Button_Click event handler that I setup to be called once it i...

Selection in Menu (like a combobox)

I currently have a combobox in my statusbar for controlling the zoomlevel of a canvas in my WPF application. I now want to move this into a menu instead of having it in a separate combobox. My current solution looks like this: <ComboBox ItemsSource="{Binding ZoomLevels}" SelectedValue="{Binding Path=Scale, Mode=TwoWay, UpdateSourceTri...

StackPanel location changes at runtime

I have a ToolBar WPF control which has a Stackpanel docked to right. I use this toolbar control in 3 other WPF controls by adding in the XAML. When I verify in the XAML the Stackpanel location is same for all 3 controls. But when I run my application, for one of the 3 controls, the StackPanel in the ToolBar control shifts to left. <S...