wpf

Changing Entities in the EntityFramework

Hi! I have the following scenario: Entities are loaded from the database. One of them is presented to the user in a Form (a WPF UserControl) where the user can edit properties of that entity. The user can decide to apply the changes to the entity or to cancel the editing. How would I implement something like this with the EntityFram...

WPF Canvas: Children.Add() hanging on background thread?

...or... "What evil in the depths of WPF have I awoken?" I'm creating a Canvas on a background thread and rendering it to a bitmap. I've had this working in production code for over a year now without problems. I do the following: create a Canvas object create a new NameScope object assign that NameScope to the Canvas draw whatever I...

Custom Dependency Properties and TwoWay binding in WPF

We have an object that derives from DependencyObject, and implements some DependencyProperties. Basically something like this: class Context : DependencyObject { public static readonly DependencyProperty NameProperty = DependencyProperty.Register ("Name", typeof (string), typeof (Context), new PropertyMetadata ("")); public s...

Attached Collection Items Losing Data Context

I created an attached property, AttachedBehaviorsManager.Behaviors that is to be used as an MVVM helper class that ties events to commands. The property is of type BehaviorCollection (a wrapper for ObservableCollection). My issue is that the Binding for the Behavior's Command always winds up being null. When used on the buttons it works ...

Using a Button to navigate to another Page in a NavigationWindow

I'm trying to use the navigation command framework in WPF to navigate between Pages within a WPF application (desktop; not XBAP or Silverlight). I believe I have everything configured correctly, yet its not working. I build and run without errors, I'm not getting any binding errors in the Output window, but my navigation button is disa...

how can i convert a wpf application to exe

Hi this is jalpesh I am newbie to the stackoverflow site. But I like the cocepts of the stackoverflow. I am asking a question How can i convert a wpf appplication to a .exe which will run on all microsft windows operating system. ...

WPF Custom Draw Multiple Progress Bar

In processing a group of items, I wanted to display a unified image of the status of the group, so I essentially made a Grid of a number of progressbars with transparent backgrounds and various colored foregrounds all at the same cell. I'm running into some transparency artifacts (purple bar is actually purple under the green, and som...

Animate row disappearance in WPFToolKit DataGrid

I have downloaded WPFToolkit, and I am using the DataGrid provided in this package. I am trying to animate a row disappearance when the row is removed, but I don't know how to do it. Does anyone know how it can be done? ...

WPF: Animate Height of ListView when final height is unknown

I have a ListView, that is defined very simply in my XAML like so <ListView Name="myListVew" MaxHeight="200" Visibility="Collapsed"> <ListView.View> <GridView> <GridViewColumn Header="Line" Width="Auto" DisplayMemberBinding="{Binding Line}" /> <GridViewColumn Header="Error" Width="Auto" DisplayMemberB...

Data bound radio button list in WPF

So I have a list of options in a data object, and I want to make the equivalent of a radio button list to allow the user to select one and only one of them. Functionality similar to a databound combo box, but in radio button format. Silly me, I thought this would be built in, but no. How do you do it? ...

How to change BK color of DatePicker's Calendar

How to change the background color for a DatePicker's Calendar? Thanks! ...

Getting started in WPF

We are evaluating the use of WPF for an upcoming project. We plan to "commercialize" some of our internal tools and could really use some of the effects WPF offers. We also like the idea of the design layer and code layers being independent to allow concurrent work. Where can I find a simple UI built with WPF (XAML) that I can pull apa...

Controls "out of window/chrome" in WPF

Is there a way to have controls/images/etc "out of" the Window/Chrome (ie, Aero's glass) in WPF? An example of what I mean is the WPF Yahoo Messenger which was released (and then discontinued) awhile back. The WindowStyle looks like it is set to None, but AllowTransparencies/CanResize set to false/true respectively - and the avatar is ...

Why everything in WPF is blurry?

Can someone explain why everything in WPF is blurry? Is this something that can be fixed? ...

How to move my RoutedCommand handler from View-codebehind to ViewModel?

The following RoutedCommand example works. However, the handling for the button which executes the command is in the codebehind of the view. The way I understand MVVM, it should be in the ViewModel. However, When I move the method to the ViewModel (and change it to public), I get the error "ManagedCustomersView does not contain a defin...

WPF ComboBox clear

I have Two radio buttons. If i check first radio button The below data will populate in the combobox. After that i will check another radio button, i want to clear the combo box values. RadioButton Height="29" HorizontalAlignment="Left" Margin="143,193,0,0" Name="rdoEmployee" VerticalAlignment="Top" Width="61" FontSize="20" Checked="...

WPF render performance with BitmapSource

Hi! I've created a WPF control (inheriting from FrameworkElement) that displays a tiled graphic that can be panned. Each tile is 256x256 pixels at 24bpp. I've overridden OnRender. There, I load any new tiles (as BitmapFrame), then draw all visible tiles using drawingContext.DrawImage. Now, whenever there are more than a handful new til...

How to use a App.config file in WPF applications?

I created a App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="xmlDataDirectory" value="c:\testdata"/> </appsettings> </configuration> Then I try to read the value out with this: string xmlDataDirectory = ConfigurationSettings.AppSettings.Get("xmlDataDirector...

what is the most efficient way to identify and replace an object within an ObservableCollection?

I have a method that receives a customer object which has changed properties and I want to save it back into the main data store by replacing the old version of that object. Does anyone know the correct C# way to write the pseudo code to do this below? public static void Save(Customer customer) { ObservableCollection<Cu...

Image drag and drop in wpf application.

I want to drap and drop a image on wpf application form. Can any one give me the code and other links for that? ...