wpf

xaml font spacing - can it be set in points?

When using fx. Word, I'm able to specify how much the font spacing should be reduced in points (ie. Condensed 3 pt). In XAML I can only use values from the FontStrech enum. Is there any other way specify the condensing in XAML, or is the only alternative to use a transformation to achieve something similar? ...

How to use AttachedCommandBehavior in a new project?

I've downloaded this AttachedCommandProject and ran it and it works well, enables me to e.g. put a MouseDown command on a Border element and handle that with a command in my ViewModel. Now I would like to add this AttachedCommand functionality to my MVVM Visual Studio Template. I copied all the necessary files into the my Commands fold...

Saying "ModelViewViewModel" or "MVVM" out loud is too awkward! Alternatives?

Hi, This may seem really silly to you, I admit, but when discussing the Model-View-ViewModel pattern with my teammates, it's very awkward to pronounce the term. "ModelViewViewModel" or "Emm-Vee-Vee-Emm" don't exactly roll off the tongue. Especially when you're not a native English speaker. So I'm looking for an alternative. Something q...

WPF binding not notifying of changes

I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and databinding so apologise if I am asking a really dumb question :-)) Firstly, I have a linqToSql entity class Contact with an EntitySet<Booking> property Bookings on it. If I directly bind this Bookings property to a ListView, the application seems to correctly no...

How can I attach two attached behaviors to one XAML element?

I've implemented the attached command behavior pattern found here and it works well to allow e.g. a Border to have a left- or right-click event that fires in the ViewModel: XAML: <Border Background="Yellow" Width="350" Margin="0,0,10,0" Height="35" CornerRadius="2" c:CommandBehavior.Event="MouseLeftButtonDown" c:Comman...

WPF: How do I allow scrolling with the mouse wheel in a ListView while dragging ListView items?

I have implemented drag and drop in a ListView in my WPF application. Items can be dragged and dropped inside the ListView, and also into a TreeView that is beside the ListView. Currently, I have it set up so that when you drag to the bottom of the ListView, it automatically scrolls down the list. What I'd like to know is if there's ...

WPF - Compilation error: Tags of type 'PropertyArrayStart' are not supported in template sections

Ordinarily I wouldn't just post an error message on SO, but after a Google search only found one hit, I thought I'd at least open the floor for this error here on SO. I have a custom control called Sparkline with a dependency property called Values of type unit[]. Here's an example where I use it in a DataTemplate: <DataTemplate DataT...

MVVM ICommand alternative

I have begun creating a wpf mvvm app. It seems a vital ingredient to the ViewModel is a bunch of ICommands to have a loosely coupled way of allowing the view to interact with the viewmodel. My question is this, why can't I bind directly to a method? I have used Josh Smith's RelayCommand implementation of ICommand that allows you to in...

Why would my XAML editor be giving me an error but the project compiles and runs fine?

I've implemented the Attached Behavior Command pattern which compiles and runs fine, but strangely my XAML editor is giving the error: The attachable property 'Behaviors' was not found in type 'CommandBehaviorCollection'. in this XAML: <c:CommandBehaviorCollection.Behaviors> <c:BehaviorBinding Event="MouseLeftButton...

Converter Binary to Image WPF;

Hi I'm trying to create a converter to Convert my images in a database ,datatype"Varbinary(Max)" to populate my DataGrid in WPF but i have 2 error i show you the Converter: public class BinaryToImageConverter : IValueConverter { public object Convert(object value, System.Type targetType, object parameter, System.Globalization.Cultur...

Window StateChanging event in WPF

I need to handle WPF application right before it goes Minimize, not when it's already there. I found on Window object StateChanged, but it fires when Window object is already in Minimize state, then it's too late. So, I need something like "StateChanging" event to handle, while Window object is still in previous state. Is it possible t...

Style a WPF Expander to look like an Outlook ListView group header

How can you style a WPF Expander image to be +/- e.g. to look like an Outlook ListView group header as shown in the image below: Open Closed ...

WPF : Extend Theme's style - StackOverflowException

I want every button to have 5 points margin, in addition to Royale theme style. Window1.xaml: <Window x:Class="_styles.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <Resource...

Using ObjectDataProvider in XAML to bind property crashes VS

Sorry for a very specific question, bot why VS2008 and VS2010 crashes with this code? I though it's a common to use ObjectDataProvider to bind property. I seen examples in many places on the web, but werether I try to use it I get exception and my VS closes. So, what is wrong with my code? Should I register a bug for VS? <Window x:Cla...

Why does VS.NET attempt to include Microsoft.Windows.Design.Extensibility for WPF and ClickOnce?

I built a WPF application in VS.NET 2008 using ClickOnce deployment. It ran great on any machine that had VS.NET installed, but my business users received an error: "Unable to install or run the application. The application requires that assembly Microsoft.Windows.Design.Extensibility Version 3.5.0.0 be installed in the Global Assembly...

WPF - Switching from WPF app to xbap

I have a working WPF application. I would like to see it running as an xbap. What do I need to change in my WPF app to make it run as an xbap? ...

UIElements aside Tab Headers

Is there a way to place something (a custom UIElement) in place on the right of TabItems' headers, so that the headers will consider its size. I feel like there should be a data template for them, but I do not know what to read or how to query google for that. ...

Using F1 Help (CHM format) With WPF

I've been working on a WPF application for a while, and the time has come to attach the CHM format help document to it. But alas! HelpProvider, the standard way to show CHM files in Winforms, has magically vanished and has no counterpart in WPF. I've been trying to use WindowsFormsHost to spawn a new control so I can actually display th...

WPF: Any cool UI ideas i can look at?

Windows Presentation Foundation (WPF) was going to hopefully usher in a new era of cool applications and user interactions. Television shows and movies have always been good at coming up with cool prop (i.e. non-functional) user interfaces. CSI, Minority Report, Quantum of Solice, all show off cool things that people might wish compute...

How to make a TreeView's and ListBox's SelectedItem stay in sync?

Hi, I'm certain this has come up before, but I haven't been able to find the answer. I made a basic ViewModel that contains a list of People (an array of Person) with a property called SelectedPerson, which naturally points to the currently selected Person in the list of People. I also have a ListBox and a TreeView that are databound t...