wpf

Custom Checkbox style for WPF

I would like to skin a wpf default checkbox to something custom. Since it does not really make sense to start off a entirely new control, i'd like to override the Windows Chrome template binding for the Bulletchrome sub component of the checkbox. However I cannot do this like I can with checkboxes for example. tried using something like...

Is INotifyPropertyChanged only for the presentation layer?

The INotifyPropertyChanged is obviously very useful in the view model for data binding to the view. Should I also use this interface in other parts of my application (e.g. in the business layer) when I want notifications of property changes, or I am better off using other notification mechanisms? I realize that there is nothing stopping...

How can we cast Frame.Content to a Page type in WPF

Hi; Basically; I need to invoke a method on my WPF page, from a WPF frame where I load the WPF Page. I get the loaded page using Frame.Content property, and cast it to my page type since Content property returns Object type. The project builds successfully, however it throws InvalidCastException at runtime. //This line throws InvalidCas...

WPF User Control hell with MVVM and Dependency Properties

This is what I'm trying to do: I'm writing a UserControl that I want to be consumed by other developers. I want end users to be able to use my control using Dependency Properties. <lib:ControlView ControlsText={Binding Path=UsersOwnViewModelText} /> I'm using the MVVM pattern. I'm binding my ViewModels to their View's using <DataTempl...

MVVM Light toolkit - maintained? Here today - gone tomorrow? ...

Hi there, I have been taking a look at mvvm light toolkit, i must admit i haven't got a lot of experience with it but i live what i see.. I did use the mvvm toolkit (microsoft) but currently use vs 2010 and no templates are available as yet. I was looking for some insight into mvvm light toolkit... Is it always maintained ? i..e its...

WPF MVVM: TextBox and default Button binding does update too late

I've got a simple WPF dialog with these two controls: <TextBox Text="{Binding MyText}"/> <Button Command="{Binding MyCommand}" IsDefault="True"/> Now, when I enter some text in the TextBox and click the button using the mouse, everything works like expected: the TextBox will set MyText and MyCommand is called. But when I enter some t...

WPF datagrid column heading span more than once column

In a WPF datagrid is it possible to group column headings? What I'm after is | Column 1 | Column 2 | Column 3| | a b c | a b c | a b c | | z x y | z x y | z x y | I've searched around and can't see an obvious way of doing this. I could use a templated column and then mimick the extra cells within the each template bu...

Align Button on a grid with InkCanvas

I am using an InkCanvas to arrange buttons. (resize, position). Does anybody know an easy way to align these buttons automatically on a grid. I.e. I only want to allow every tenth pixel to be a valid corner for a button that is moved around. ...

In WPF, how do I update the object that my custom property is bound to?

I have a custom property that works perfectly, except when it's bound to an object. The reason is that once the following code is executed: base.SetValue(ValueProperty, value); ... then my control is no longer bound. I know this because calling: base.GetBindingExpression(ValueProperty); ... returns the binding object perfectly - U...

WPF - copy/paste selection with custom font family

I have a custom font family embedded in my WPF application which I can reference by specifying a base URI and font family name. new FontFamily(new Uri("pack://application:,,,/Fonts/"), "./#My Custom Font Family"); However, when I copy a selection which uses this font the xaml on the clipboard resembles the following <Run Text="Foo" ...

WPF Toolkit DataGrid Performance Issue

Hi All, I am facing a performance issue with WPF Toolkit datagrid. In my application I have created a view containing multiple Data Grids (around 25) with about 5 rows in each grid. The grids are placed in an ListView, the problem I am facing is of rendering of my view. Can anyone guide me to resolve the issue. Thanks ...

How Do I Bind a "selected Item" in a Listbox to a ItemsControl in WPF?

LowDown: I am trying to create a Document Viewer in WPF. It will allow the user to preview selected documents and if they want, compare the documents in WPF. So they can view them side by side. The layout is this: Left side is a full list box. On the right side is a Collection or an Items control. Inside the items control will be a co...

Add an extra row in a ListBox with XAML.

I have a ListBox with radiobutton on the horizontal line. Number of radiobuttons is optional. The text for each radiobutton is taken from a list of the model. Which radiobutton that is selected will be determined by the property SelectedOption. If none is select it shall be set to -1. The problem is that I wish that in addition to the ch...

WPF Richtext box content

how do i get the richtext box's content with all the formatting intact. i used a TextRange object to get the content out of the richtext box but wen i get its .text property all its formatting is gone ... how do i get the formatted content in richtext box in wpf. ...

help me with Converter please

I'm trying to bind element's Height value to Checkbox.IsChecked property. Why that's not working? <Window.Resources> <local:BoolToHeightConverter x:Key="BoolToHeightConverter"/> </Window.Resources> <Button Name="JustBtn" Content="Hello World"/> <CheckBox IsChecked="{Binding ElementName=JustButton, Path=Height, Converter=BoolT...

Progress bar in data grid view

Is there a way to have a progress bar in a cell in a DataGridView? At design time, you can add a TextBox, Button, Image, Link, ComboBox, or CheckBox, but not a ProgessBar. Is there a better control in WPF that will allow this? ...

Loading Content images from Blend from separate project

Hello, I have a VS2010 solution with 5 projects. Two of these projects are called: MyResources Application The Application project contains all of the views and viewmodels for the application to run, and the Resources project contains all the images, resource dictionaries, etc for theming and skinning. The way I have images set up in...

M-V-VM, isn't the Model leaking into the View?

The point of M-V-VM as we all know is about speraration of concerns. In patterns like MVVM, MVC or MVP, the main purpose is to decouple the View from the Data thereby building more flexible components. I'll demonstrate first a very common scenario found in many WPF apps, and then I'll make my point: Say we have some StockQuote applicati...

WPF and LINQ to XML databinding to a listbox problem

Hi, I'm having trouble correctly binding a listbox to an XML datasource (text .xml file). I'm learning how to use WPF and LINQ to XML by following the Microsoft example with the books list, which binds to an inline XML source, shown here... http://msdn.microsoft.com/en-us/library/bb669149.aspx What I am trying to do is change this a...

How to extend WPF hit testing zone for a Path object.

Wpf hit testing is pretty good but the only method I found to extend the hit zone is to put a transparent padding area around your object. I can't find any method to add a transparent area arround a Path object. The path is very thin and I would like to enable hit testing if the user clicks near the path. I can't find any method to exten...