wpf

WPF DataGrid: How do you get the content of a single cell?

How do you get the content of a single cell of a WPF toolkit DataGrid in C#? By content I mean some plain text that could be in there. ...

Reference nested type in ObjectDataProvider markup

I'm trying to use a nested type in my ObjectDataSource a la this article. It doesn't seem to be working for me. <ObjectDataProvider x:Key="myProvider" ObjectType="{x:Type local:OutsideClass+InsideClass}" MethodName="GetObjects" /> ...

Making a DataGrid Column Header sortable in WPF using C#

I am using C# in Visual Studio 2008 and I have install the WPF Toolkit. I created a DataGrid in testtest.xaml. The ID and Parts $ columns have the ability to sort the DataGrid by clicking on their respecteive column headers. However, the column header Complete Date does not have that ability. I used the tag "DataGridTemplateColumn" t...

How to control the order of module initialization in Prism

I'm using Prism V2 with a DirectoryModuleCatalog and I need the modules to be initialized in a certain order. The desired order is specified with an attribute on each IModule implementation. This is so that as each module is initialized, they add their View into a TabControl region and the order of the tabs needs to be deterministic and...

WPF DataGrid - How to stay focused on the bottom of the DataGrid as new rows are added?

I am using DataGrid from the WPF Toolkit and I need to be able to maintain focus on the bottom of the grid (i.e. the last row). The problem I'm having right now is that as rows are added the scrollbar for the DataGrid doesn't scroll along with the new rows being added. What's the best way to accomplish this? ...

Making default control template editable in Expression blend

I created my own ContentCOntrol in XAML, e.x.: <ContentControl x:Class="server.ui.DiamondButton"> <ContentControl.Template> <ControlTemplate TargetType="src:DiamondButton"> <...> </ControlTemplate> </ContentControl.Template> </ContentControl> This sets the default template and generally works great....

DataGridView draw bug in WPF

I am using WindowsFormsIntegration in a WPF project to add a DataGridView and I am having some problems with it simply being drawn in the window (it takes a while). I am aware of the solution with the doublebuffered datagridview but how can you use this in XAML for WPF or in C# for WPF? An example of the doublebuffered datagridview in ...

How do I suppress script errors when using the WPF WebBrowser control?

I have a WPF application that uses the WPF WebBrowser control to display interesting web pages to our developers on a flatscreen display (like a news feed). The trouble is that I occasionally get a HTML script error that pops up a nasty IE error message asking if I would like to "stop running scripts on this page". Is there a way to su...

C#/WPF: Get Binding Path of an Element in a DataTemplate

Hello, How can I get the Binding Path of an Element in a DataTemplate? My XAML looks like this: <GridViewColumn Header="Double"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding TotalValues, Mode=OneWay, StringFormat=\{0:0\'0.00\}, Converter={StaticResource...

MVC / MVP / MVVM What the Heck?

I recently worked on a .Net WPF project to build a retail point of sale system where I used the MVP pattern for the first time. It took me a little while to wrap my head around the change of approach but once I did that I thought that the concept rocked! My question is this: what is the distinction between MVC, MVP and MVVM? If there is...

WPF CustomControl: OnApplyTemplate called after PropertyChangedCallback

I am creating a WPF CustomControl that has a dependency property with PropertyChangedCallback. In that Callback method I try to set values on some of the control's parts that I retrieve from OnApplyMethod using the GetTemplateChild() method. The problem is that the PropertyChangedCallback is (on some systems) called before OnApplyTempla...

Loading .net 3.5 wpf-forms in a .net 2.0 application

I'm trying to load and host a WPF control in a .net 2.0 windows forms application. The WPF control should only be loaded if .net 3.5 is installed. I found a link to Hosting WPF Content in an MFC Application and that is about what I'm trying to do but my C++ knowledge isnt sufficient to be able to 'translate' it to .net. Anyway, here is...

Printing the contents of a WPF WebBrowser

I'm trying to print the contents of a WPF WebBrowser control so that no print dialog is shown, but am having no luck. I have tried the following and am sure it did work: PrintDialog printDialog = new PrintDialog(); printDialog.PrintDocument(((IDocumentPaginatorSource)browser.Document).DocumentPaginator, "My App"); but for some reas...

how to set all row heights of the wpf datagrid when one row height is adjusted

Im using the wpf datagrid and am looking for a way to set the height on all of the rows when the user adjusts one of them. I know the datagrid has a RowHeight property that sets all of the row heights at once, but the how of catching an individual row height changed escapes me ...

Release Notes/History for .NET? Problem with BeginInvoke

We have some piece of code that behaves differently in two .NET versions: * 3.0.30618 (latest .NET 3.0 version) * 3.0.04506 (.NET 3.0 RTM) It does not work in the RTM version. We traced the problem to a call to system.windows.threading.dispatcher.BeginInvoke. The delegate passed never ran. Any tips or suggestions for solving this...

Partial update of WPF Animations in Storyboards/ParallelTimelines without a new Begin()?

I'm working on a WPF application that displays a number of graphical elements (RectangleGeometries and Splines) that are animated in sync with video displayed in a MediaElement. The synchronization tree is constructed as follows: Storyboard (for control: Begin(), Pause(), Seek() ...) MediaTimeline (connected to the MediaElement using...

WPF Combobox databinding to a L2S table

Here is what i have: a SQL CE database, that holds this Category table, with id and name columns only. dbml generated with sqlmetal singleton (static class) that exposes the linq DataContext. in the code-behind file, i have a property like follows: private System.Data.Linq.Table Categories { get { return LibraryDataSt...

Creating SelectionBorder: Bit in the face by decimal rounding?

I am currently implementing a class called SelectionBorder in WPF. It's derived from the Shape class. It basically looks like this: public class SelectionBorder : Shape { public Point StartPoint {get; set;} public PointCollection Points {get; set;} public double StrokeLength {get; set;} protected override Geometry Definin...

WPF ListBox expand selected item

I have the following code snippet (copy and paste into kaxaml, xamlpad, etc to try it) that collapses all but the selected item. However, I want to revert back to all visible when the mouse is not over the ListBox and I just cannot get it to work short of going code behind. I am using the IsMouseOver ListBox property to set selected item...

WPF Controls Dll question

I've started work on a WPF controls dll which will be referenced from winforms applications. My first control in this project is a simple container control. It's purpose in life is to provide a modaless, transparent docking window to the Winforms app. My problem with this control is that I can't get it to move when I try to drag it. ...