wpf

WPF Beginner Tips

I am starting out with WPF and am surprised at how completely different it is from anything I have done before, there is a lot to take in. Can anyone recommend stuff that is worth knowing up front that will make life easier when it comes to developing a WPF app? Thanks in advance. ...

WPF ListView show Image

Hi, I have a simple class that contains a string and an WPF Image control: public class User { public string Name { get; set; } public System.Windows.Controls.Image Image { get; set; } } Now I'm binding a list of instances of this class to a ListView. What I would like to do now is make ListView display the Image property. ...

WPF: What is the right base class for collections used in data binding?

I am building an object model with strongly typed collection classes (e.g. CustomerCollection). I want to support full two-way binding on both the collection itself and all of the data models in the collection. For the models it seems like INotifyPropertyChanged is the right way to wire up the models. But what inferface/base class shoul...

Need suggestions for developing Scrabble like game in WPF

Hi I want to develop a game like Scrabble in WPF for which I need some suggestions For Visuals: 1. What controls can be utilized to represent a (let's say 9 x 9) matrix? I would need ability to associate each cell with an id to know its state at all times during execution. How can I inject different visual properties to a cell of matr...

CollectionViewSource Use Question

I am trying to do a basic use of CollectionViewSource and I must be missing something because it is just not working. Here is my XAML: <Window.Resources> <CollectionViewSource Source="{Binding loc:MainVM.Instance.MapItems}" x:Key="MapCV"> <CollectionViewSource.GroupDescriptions> <PropertyGroupDescription PropertyName="So...

Free WPF Carousel Implementation

I have seen a lot of Carousels to show off WPF. I have never really need one before now though. Is there a decent free one? I have access to the Dev Express one, but I am making an open source project and would rather not put code in it that others cannot easily compile. ...

WPF - Get the ListBox row object from a button that is on the DataTemplate

I have a list box with a data template. The template has a button on it. When the button is clicked I want to do some logic with the object that is each row (in this cased an object called WorkItemTypeMappings). In the OnClick how can I go from the Button (object sender) to the object that is row that the button is on? Here is the XA...

object reference is not set to an instance of an object repository

I am getting an XAMLParseException that is really covering up another exception. Here is part of the stacktrace: Message=Object reference not set to an instance of an object. Source=AssignmentOrganizer StackTrace: at AssignmentOrganizer.MainWindow..ctor() in C:\Users\Mohit\Documents\Visual Studi...

How to set property in IDataErrorInfo validator from Xaml

When using IDataErrorInfo in WPF is there a way to pass parameters to the validator. For instance I have a DueDate Datepicker. When validating for a new task I want to restrict the date allowed to today or later but when editing I need to allow for DueDates before today since a task can be edited that is past due. My DatePicker in Xaml ...

Create a custom Full sized Calendar Control

How can I make a custom control that show the calendar control in a much larger view. Like this or like the calendar view in outlook 2007. Do I have to make a custom class or can I just attempt to resize the calendar. I am doing this in WPF so I use WPF Toolkit ...

When should you not use an ObservableCollection and Databinding?

dhopton's comment got me thinking. What are some situations where you wouldn't want to use an ObservableCollection? ...

Using bindings to control column order in a DataGrid

Problem I have a WPF Toolkit DataGrid, and I'd like to be able to switch among several preset column orders. This is an MVVM project, so the column orders are stored in a ViewModel. The problem is, I can't get bindings to work for the DisplayIndex property. No matter what I try, including the sweet method in this Josh Smith tutorial, I ...

System.Windows.Application.OnLoadCompleted never reached.

Hello I am trying to handle the Application.LoadCompleted event but it's never triggered. Instead I am seeing the MainWindow. I tried attaching the event by either xaml, or directly by overriding the OnLoadCompleted method of the Application class. ...

how to update a cell in DataGrid which is binded with string[][] array

I have a DataGrid and a string[][] dataSource array as a source data for this DataGrid. I use following code to set binding: dataGrid.ItemsSource = dataSource; for (int i = 0; i < columns; i++) { dataGrid.Columns.Add(new DataGridTextColumn { Binding = new Binding(string.Format("[{0}]", i)) }...

Databinding of WPF Toolkit DataGrid to LINQ to SQL queries

When binding WPF Toolkit DataGrid to SQL database through LINQ to SQL, how to correctly set binding source: should it be some generic collection, filled and updated by LINQ to SQL queries or there is a possibility to directly connect DataGrid with LINQ to SQL queries? ...

help with grouping and sorting for TreeView in xaml

I am having problems getting my head around grouping and sorting in xaml and hope someone can get me straightened out! I have creaed an xml file from a tree of files and folders (just like windows explorer) that can be serveral levels deep. I have bound a TreeView control to an xml datasource and it works great! It sorts everything alp...

WPF: Has anyone seen a complete example for PyBinding?

This looks cool, but I haven't seen any complete examples yet. http://blog.pixelingene.com/?p=340 ...

WPF making a navigation panel in overlay (in front of other content)

Hi, I have a small WPF application where i am displaying an image. I would like to have a kind of transparent navigation panel in the bottom, where i have several small buttons (rotate left/right, pan etc.). But how to make the navigation panel in front of the image? I have tried with a grid with two rows, but obviously the navigationpan...

WPF/BackgroundWorker and BitmapSource problem.

Hi, I am a beginner with WPF and trying a home project to become familiar with the technology. I have a simple form where the user selects an image file, I then display EXIF data along with a thumbnail of the image. This is working fine but when I select a RAW image file (~9 MB) there can be a slight delay while the thumb loads, so I ...

WPF: Setting named color to resource?

I am modifying the control template of the WPF Calendar control to change the color of text and the Previous and Next arrows on the control. I want to set the color to a local SolidColorBrush resource called MyTextBrush. The Previous and Next buttons have separate control templates, and each draws a Path object for its button's arrow. ...