wpf

How can I allow user to sort columns on a LINQ-to-SQL WPF Datagrid?

I have successfully set up a WPF Datagrid with the March 2009 WPF Toolkit, created LINQ-to-SQL classes from the Northwind database, bound the WPF grid with this code: var customers = from c in _db.Customers select c; TheDataGrid.ItemsSource = customers; I can move columns from left to right, got delete columns to work...

Create custom generic list with bitmapimage

Hi, In my WPF project there is a listbox in which I have to display images and next to each image their text (for example : date the photo was taken, location etc). I have tried creating a generic List but I still can't assign it to the listbox Something like Bscially I have been trying something on this lines. public class LoadImage...

Is there WPF XAML for Uniform fit but constant StrokeThickness

I what to draw a circle that uniformly fits into its space, with a constant a stoke thickness. A ViewBox gets me the uniform fit, but not the constant stoke thickness. <Viewbox Stretch="Uniform" MinHeight="10" MinWidth="10" > <Ellipse Height="10" Width="10" Fill="Red" StrokeThickness="1" Stroke="Yellow"/> </Viewbox> ...

Injecting properties into .NET classes post-compile

I'd like to implement the ViewModel part of WPF's MVVM pattern without referencing WPF assemblies. The problematic part is command routing, which requires that ViewModels implement properties of type ICommand so that command bindings can work. Now, I can avoid the ICommand and simply declare the properties as object. Everything still wo...

WPF Style Trigger

I am trying to get a row in a datagrid to turn red if the value of a checkbox within the datagrid is true. Any ideas? Here is what I have so far. I am currently turning the columns red if the mouse rolls over the row. ...

Capturing the first frame of a video with WPF

I need to capture the first frame of a video uploaded on an asp.net website. I really would like to do this with WPF (if it's even possible), but if anyone knows an easier way, I am open to that too. I have seen examples of this using MediaPlayer and RenderTargetBitmap in WPF, but each example assumes the video is accessible via a UR...

How can I create a group footer in a WPF ListView ( GridView )

I have a ListView that displays sales orders, and groups them by status. In WinForms I had a footer at the bottom of each group that displayed the Total sale price for each group, and I would like to do the same in WPF. I have figured out how to group the orders, but I can't figure out how to create a footer. This is my current group s...

ElementFlow: Exception in MeasureOverride

I'm trying to use FluidKits ElementFlow-control in my application, but get an exception in the MeasureOverride method of ElementFlow. Layout measurement override of element 'FluidKit.Controls.ElementFlow' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size. In the sample applicatio...

Why is ASP.NET MVC limited to ASP?

Duplicate MVC .NET For the Desktop? I've developed some ASP.NET MVC apps, and loving the framework. However, one thing I don't quite understand is why it's limited to web UIs. It seems like one of the reasons for a separation of the view and controller is to allow for multiple views to reuse the same controller logic. For example...

WPF binding multiple controls to different datacontexts

I have a scenario where I don't really know how to bind data to controls hosted in a UserControl to multiple datacontexts. The data i want to bind comes from 2 classes UserInfo, UserExtendedInfo The datacontext of the UserControl is set to UserInfo so i can bind most controls easily doing the following <Label Name="LblEmail" Text="...

WPF: Applying styles throught the application

In WPF, where can I put styles that should be applied throughout the application? This is because currently, whenever I use a style, I put it in the <Window.Resources> section of every window, which ofcourse is wrong in so many ways. So where can I put these styles to apply throughout? ...

Use BuildManager.GetType to look through assemblies in WPF

I have existing code for an ASP .NET application that uses reflection to load dataproviders. I would like to re-use this code in a WPF application but it appears that BuildManager.GetType only looks through top level assemblies if the app isn't ASP .NET. Does anyone know how to get around this limitation? The following code throws an ex...

How to make WPF Expander Stretch?

The Expander control in WPF does not stretch to fill all the available space. Is there any solutions in XAML for this? ...

C# WPF custom control not responding to XAML properties at design-time?

I've created a UserControl which is essentially a button. It's got an Image and a Label on it and I've created two properties to set the Image's source and the Label's text like so: public ImageSource Icon { get { return (ImageSource)this.GetValue(IconProperty); } set { this.SetValue(IconProperty, value); icon.Source = value; ...

Silverlight 2.0 Perspective/Z-Scale

Hello, How can I set Z-Scale some silverlight element ? I can see Z-Scale property in Properties > Transform > Scale > Z but it isn't active, I can't modify. What do I need to do to edit Z-Scale. Thanks. ...

XAML Rectangle Property Trigger problem

I have a WPF app with a Rectangle trigger defined as: <Style TargetType="{x:Type Rectangle}"> <Setter Property="Rectangle.StrokeThickness" Value="1"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Rectangle.StrokeThickness" Value="4"/> </Trigger> </Style.Triggers> </Style>...

Getting a DynamicResource in code

hi there, the FrameworkElement's FindResource method allows to get resources defined in this frameworkelement. however, i have some dynamic resources located in another assembly loaded at runtime. Accessing it with DynamicResource from within XAML is no problem, but i wonder how i can get access to Dynamicresources from code (e.g. datat...

In WPF, how can I cancel the keypress after processing it with PreviewKeyDown?

In my WPF Datagrid I capture the "delete" key, process it, and then the datagrid itself deletes the row from the UI by continuing to process its own handler for the delete key (which is what I want). But now I want CTRL-S to open up a search bar, which it does, but it also goes on to blank out the cell the user was on when he pressed CT...

Why does accessing my Storyboard x:Name work in Silverlight but not in WPF?

The following WPF code gets the error: The name 'zipButtonOut' does not exist in the current context. However, the identical code works in Silverlight as I demonstrate here: http://tanguay.info/web/index.php?pg=codeExamples&amp;id=65 What do I have to do to the WPF code to be able to access the Storyboard within Window.Resources? I tri...

App Crashes when changing tabs that contain listboxes with control templates on ItemContainerStyle and bound to CollectionViewSource

Hi, my problem is that i have three tab controls each with a listbox that has style for both the ListBox and the ItemContainerStyle, the styles are the same on all listboxes inside the tabs. two of the tabs are databound using a CollectionViewSource. The problem is as soon as i try to go into tab 2 i get an exception and i cant seem to...