wpf

WPF/MVVMDo I need a dependency Injection tool like Unity/LightCore when using a ViewModelLocator

Hello, I would like to use a ViewModelLocator and I would like to know wether it is a basic requirement using a DI framework to make a ViewModelLocator possible? ...

How to DataBind to specific item properties in an ItemsControl in the most elegant way?

Scenario: A ListView is DataBound to an ObservableCollection<CustomClass> and is displaying it's items through a custom ItemTemplate. The CustomClass just contains three string properties and one boolean property and already has INotifyPropertyChanged implemented on every of it's four properties. The custom ItemTemplate of the ListView h...

How to localize the WPF 4.0 DatePicker control

When you clear the box on the new WPF 4.0 DatePicker control it shows "Select a date" Is there a way to localize the text? ...

Do you know a WPF MonthPicker control?

I'm looking for a MonthPicker control, a control just like a DatePicker but that you can only select the month and the year. Before start writing one from scrath I would like to know if something like this exists. ...

Weird situation with TextBox.Text property in WPF

This one has me stumped. I found some code posted by Ray Burns to create a DependencyProperty for a TextBox that allows you to restrict which characters can be deleted by the user. I modified it a little to instead restrict which characters can be inserted, and used that to create TextBoxes that only accept numeric input (plus the decima...

FlowDocumentPageViewer mouse scroll navigates to the next pages instead of scrolling to the end of the page first

I am trying to show a PrintPreview in ActualSize Mode and I have the following structure in my xaml: The problem is when I mouse scroll, instead of scrolling to the end of the page as you scroll and then navigate to the next page if any , it directly navigates to the next page and then on the last page, it scrolls to the end as you...

What property in a font file makes a program decide to simulate bold?

I am looking for a property in a font file (either from WPF's System.Windows.Media.Fonts Typeface or GlyphTypeface) or directly accessing the .ttf/.otf file that will allow me to determine if a program like Write/WordPad in Windows will apply Bold to the font. Basically, some fonts that have the Bold attribute will still get an extra bol...

Why is one of my ScrollViewer commands not working in ListBox template?

Got a weird problem here. I have created a template for a ListBox based on the standard template (i.e. I have not changed anything other than what I indicate below). I am trying to add a couple of buttons to the side of the template so that I can scroll the ScrollViewer (which is part of the standard ListBox template) left and right. Th...

How do I get the dimensions of a WPF element at run-time without specifying them at compile-time

The problem? <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values Doulbe.NaN. The problem is that I need to know this number. I'm not going to manually set a width and height in the XAML because that ...

WPF Calendar graphics not updating

I've got an odd problem with a WPF Calendar control. I have modified the control template to display date highlighting, and basically, it works very well. Highlighted dates are specified in a 31-element string array. If an element is null, it means the date that corresponds to that element isn't highlighted. If the string element isn't n...

Expression Blend binding list doesn't list interface properties for binding.

Made a much simpler example, hopefully someone can follow this and help me Here is my code. ViewModel public class ViewModel { private Person _noninterfacePerson; private IPerson _interfacePerson; public ViewModel() { _noninterfacePerson = new Person(); _interfacePerson = new Person(); } publi...

Prime examples of data-binding

I am implementing a barebones framework in JavaScript that just provides data-binding between objects. The data-binding can either be one-way or two-way, and potentially have multiple objects bound on some property. There are several data-binding solutions available for various languages and I am trying to get a good idea of the best of ...

WPF Treeview Databinding Hierarchal Data with mixed types

I have a bit of a complex situation with WPF Treeview Binding. I have spent the last 2 days trying Google it, and this is the closed I came up with, but it doesn't solve the issue. Here is the situation: I have an object that looks like this: public class Category { public string Name { get; set; } public List<Category> Categorie...

Play a sound file in WPF app

I put a sound file stored in the database as a Byte[] .Now,I want to play this sound file in my WPF program. How can I do this? ...

WPF DataContext ... looking for the simplest syntax.

In the following XAML UserControl I am binding a few items to properties in the UserControl's linked class. <UserControl x:Class="Kiosk.EventSelectButton" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Kiosk" Height="130"...

GridSplitter with button for pinning like behavior

I'm looking to extend the GridSplitter in some way to add a button which when click expands or collapses the control to one of the specified sides of the splitter. I've found a solution that works for Silverlight 4 but I need this to work for standard WPF in .NET 3.5 which means that the GridSplitter doesn't implement the Visual State M...

What is the style trigger when you are hovering over a button in WPF?

My question is pretty straight forward. I am trying to style the background of a button in WPF when I MouseOver/Hover on the button. <Style x:Key="StandardButton" TargetType="Button"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Background" Value="CornflowerBlue" /> </...

How to learn Autofac fast for Windows development?

I'm about to start a project where the IoC being used is AutoFac - at a new company. I have no prior experience with DI/IoC and want to get up to speed on this so I don't look toooo unintelligent. This will be for a WPF application (which again I'm not too cluey about but that will be OK) What are some good resources I could use to lear...

wpf app - why is the window size larger than I set it to?

Hi, Any ideas re why the WPF application I've starting building has a larger width and height than what I set in VS2010? That is, in VS2010 I set the height of the window to be AUTO (so it should be just high enough to contain the controls) and this seems to work visually within VS2010. But when I then run the application the window h...

Pausing an animation rotation, setting the angle value, then resuming later?

I have a situation where I have a 3d Model that has a constant rotation animation. When a user touches the screen, I would like the rotation to stop, and the user's control to take over the animation of the rotation. I tried to do this by pausing the animation, setting the angle property of the rotation locally, then resuming the rotati...