wpf

wpf method to start the application message loop

Hi All, I need to create a Form in a different thread and keep it ranning until a user performe some action in the main thread (click a button). It is not very difficult to do using System.Windows.Forms.Application.Run(new ApplicationContext()); that starts an application message loop in the current thread. But this solution requir...

WPF: How to dispose ImageBrush?

I'm using ImageBrush as a background of InkCanvas. I have to dispose the ImageBrush when deleting but the memory still raise up until the program throws an Exception (Out of Memory). I did use freeze Method and making the ImageBrush = null and giving it Empty Source but the memory still raising up. Have you found any solution to dispos...

WPF datacontext parent / child usercontrols

I have a WPF application that is made up of a window containing a usercontrol which, in turn, contains another child usercontrol. I have a dependencyProperty for a SelectedName in my second usercontrol's viewmodel. I want the parent control to be able to either access this property and display the SelectedName in a textblock in the par...

WPF ComboBox resets selected item when item-source changes

Consider the following XAML: <ComboBox Name="CompanyComboBox" HorizontalAlignment="Stretch" ItemsSource="{Binding Path=GlobalData.Companies}" SelectedValuePath="Id" SelectedValue="{Binding Customer.CompanyId, ValidatesOnDataErrors=True}" DisplayMemberPath="Name" /> GlobalData.Companies is a collection (IEnumerabl...

WPF - Implicitly style control within another control

Hi, Is it possible in WPF to implictly style a control that sits within another control? For example, style an image within a button, without styling all images? ...

Converting EPS to Xaml

I have bunch of EPS vector files that I want to convert to Xaml (WPF version, not Silverlight). What's the best tool for the job (Preferably a free one)? ...

Removing event handlers in wpf window

In our wpf app we are adding events in the constructor of our window like this: AddHandler(Keyboard.KeyUpEvent, (KeyEventHandler)HandleKeyDownEvent); this.Closing += new System.ComponentModel.CancelEventHandler(WindowF_Closing); this.Loaded += new RoutedEventHandler(WindowF_Loaded); Is it a good idea to remove these e...

clean cookies from WPF web browser control

Hi all, I encounter a problem with the WPF web browser . I need to delete the cookies each time I use the control , It remebbers previouse requests. Thanks in advance... ...

Performing a Flip animation completely through code WPF

I am try to add a flip animation to a user control I built. The user control is simple it has a 87x87 image front and back and some properties. It is suppose to represent a tile in a game I am working on for fun. I am trying to animate a flipping affect of the user picking the tile from the deck. I feel I need to do this through code...

Mouse Clicks not recognized in ui-Moving mouse out of Application bounds fixes it

Hi, I am trying to implement a drag and drop between listboxes.I successfully implemented it using the library from http://code.google.com/p/gong-wpf-dragdrop/.Everything works fine but when i had to call some custom logic which involves some selection changed events also,My ui fails to detect mouse clicks anymore.No control in my hole a...

MVVM with WPF using LINQtoSQL in a DAL along with a BLL

Hey guys I'm hoping someone can get my pointed in the correct direction regarding these new technologies. I'm still in college and unfortunately our school doesn't teach any proprietary technologies(ex. MSFT). I've got decent experience with C# however when it comes to an enterprise level app with all this new stuff, I'm a bit lost. My...

Invoking a WPF command from a WPF-embedded Winforms control

I have a WinDataGrid class that extends from an Infragistics UltraGrid. I have embedded my WinDataGrid within a WPF usercontrol using WindowsFormHost. When rows are selected, I need to invoke a predefined DelegateCommand<IList> with my collection of selected rows. How would I go about this? As background, I have a WPF app that uses bo...

WPF: GridView with an "index" column

I have a standard ListView with a GridView. Now I want one of the columns in the GridView to be the 1-based index of that line in the list, as such: | # | First name | Last name | | 1 | John | Smith | | 2 | Anne | Anderson | How do I do that? ...

Shading an area between two points in a WPF Toolkit Line Chart

I am using the charts that come with the WPF toolkit and I am trying to shade or color between two points on a line chart. For instance: I have dates on the x-axis and I want to color the area on the chart between two of those dates. Anyone have any ideas or solutions? ...

Unity & WPF - injecting a DataContext via property injection to a child control

I followed Jason Dollinger's MVVM sample from Lab49 to learn the basics of using Unity with an MVVM WPF application. I constructed a simple sample following his basic architecture, using property injection and the Dependency attribute to inject viewmodels into the views. My sample has a main window with a child user control created in ...

WPF: Binding the height of a component to another's.

I have, in a window, a Grid that contains a RadioButton, a TexBox and a Button, each in column 0, 1, 2, respectively. They all have their heights set to auto. Then, in another part of the window, I have another grid with a Label, a TextBox and a Button, in columns 0, 1, and 2. Heights are also set to auto. The problem I have is that th...

WPF ScrollViewer in other controls

Hi, When I have a control like a WPF Treeview, Naturally when the contents of that treeview exceed the maximum height or width a scroll appears. Is there a way to obtain that scroll to move it or disable it? Thanks ...

WPF control hosted in Windows Forms: Is it possible to access resource files?

I have a WPF control hosted in Windows Forms and I would like to access it's resources, specifically images. What is the best way to do that? I was thinking of using a ResourceDictionary, but I'm not sure how I can access it from within a Windows Form. ...

Can you turn off selection syncing in WPF's CollectionViewSource?

Hi everyone, I have several CollectionViewSource instances all used on the same ObservableCollection. I also have several controls that need to show filtered versions of the collection (hence the CollectionViewSources). The problem I'm having is that CollectionViewSource forces them to all have the same item selected. Is there some way ...

WPF: Stop Binding if a UI element is not visible

Can i delay binding of a ui element if the element is not currently visible. Sometimes i have a form that has some hidden/minimised elements, i would like to not update them if they are not on the screen. I suspect the answer is no, but it never hurts to ask? ...