wpf

Do you have a real world example of AttachedPropertyBrowsableWhenAttributePresentAttribute usage?

I just come across AttachedPropertyBrowsableWhenAttributePresentAttribute, but can't think of when it would be useful. Any ideals? ...

WPF: The correct way to make a standard menu

I've just started out fiddling with WPF in Expression Blend and now I'm trying to design a "normal Windows GUI" interface with a menu at the very top and some other stuff which takes up the rest of the window. Which panel do I use to make the menu always stay at the very top, take up only as much height as it needs to fit the menu items...

How to access base datacontext in Collection in xaml

I have a wpf app with the datacontext set to an instance of a viewmodel class. It all works fine except where I need to access a property of the viewmodel in a listbox with the datacontext set to a collection that is contained in the ViewModel class. On msdn it says you can escape using the \ character but that has not worked for me My ...

WPF Custom Indicator Control Question

Control : C# Code : public partial class RedGreenStatusIndicator : UserControl, INotifyPropertyChanged { public RedGreenStatusIndicator() { this.InitializeComponent(); DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor.FromProperty (ArchiverDetails.ArDetailsPrope...

WPF Combobox SelectedIndex

Hi, I am trying to use a WPF combo box to change a timer. Currently, I have in an observable collection 15 mins 30 mins 45 mins. 1 hour. If the user clicks 15 minutes, then a timer will start counting down. But my problem is, once the user clicks 15 minutes, the combo box won't let me pick 15 minutes again to reset it. I have to click...

Are value converters instantiated per-binding in WPF?

Is a separate WPF value converter object instantiated for each binding that a particular value converter class is used in? I am trying to create a two-way bit-to-boolean value converter. I would like to be able to bind a bool property (such as IsChecked) to a bit in a value type (like a ushort). I'm using the converter's parameter arg...

Problem using * in Grid sizes

Hello When I set a column's width or a row's height to star, and I fill in content that is bigger than the available rectangle, the row keeps on growing 'underground': <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Win...

Customize setup wizard

How can I customize the setup installer with my custom dialogs? I am using the Setup Wizard Project. ...

Are there any good software development "patterns" for memory intensive .net programs?

Basically I'm working on a program that processes a lot of large video and image files, and I'm struggling with the memory management side of it because I've never dealt with anything quite like this before. For instance, it stores all these images in a database, and loads a list of videos, and then you can switch between the videos an...

WPF drag distance threshold

I have a program with two WPF treeviews that allow dragging and dropping between the two. The problem is, it can be annoying to open / close items on the treeviews because moving the mouse just one pixel while holding the left mouse button triggers the drag / drop functionality. Is there some way to specify how far the mouse should move ...

WPF Binding IsSelected to ViewModel doesn't set items that haven't been shown in the List

I have a ViewModel that has an IsSelected property which I bind in my ListView.ItemContainerStyle XAML to an IsSelected property in my view model. I bring up the application and populate the view model collection (which is shown in my ListView) with a lot of items, say about 2000. Then I select everything in the list via Ctrl-A. The ite...

WPF Databinding Question

Hi all. I've written a very short app in which I'm trying to achieve the following : have the checkbox change it's state from code. I've wired up the INotifyPropertyChanged interface and was expecting to see some results but apparently the app does nothing. Is there something wrong with the databinding? Window1.cs using System; using ...

Why "Optimize Code" is needed to be turned on for my program to run without crashing?

I was given this WPF application, when I tried to run the program in Debug mode it would crash before getting to Windows1.xml. I later tried running in Release Mode and it would run successfully. I narrowed it down to that, I needed to turn on "Optimize Code" for it to work. Note: Breakpoints, stepping into from debug, and stopping on t...

Get ProgressBar to fill StatusBarItem

Hey guys, I have a status bar that I'd like to house a TextBlock docked to the left and a ProgressBar filling the remaining width. In all my other experience with the WPF ProgressBar it will fill its given container, however in this situation it doesn't auto-size at all, it just appears as a tiny circle. Setting its height and width man...

Validating several linked databound TextBox values in WPF

Hello everyone, I am trying to find an elegant way to validate two related TextBox values in WPF. The Text property of each text box is bound to a public decimal property on my class which implements INotifyPropertyChanged for TwoWay binding. I want to validate the two values such that: BiggerValue >= SmallerValue >= 0 I have succeed...

So I learned how to make images expand and contract (x,y). Is there a way for me to rotate them?

I have this code for expanding and contracting images in a sexy manner. I'd like to add a little rotation in there, just to make the image pop up, you know? Where/how do I add rotation animations to control? <Style.Triggers> <EventTrigger RoutedEvent="Image.MouseEnter"> <BeginStoryboard> ...

Is there an attribute that ignores a method on design-time?

Something like: <DesignTimeHidden()> _ Private Sub UserControl_IsVisibleChanged(sender As Object, _ e As DependencyPropertyChangedEventArgs) Handles Me.IsVisibleChanged End Sub ...

Memory leak when using WPF WebBrowser control in multiple windows

I am working on a project that makes use of the WPF WebBrowser control (System.Windows.Controls.WebBrowser). The web browser element of the program is one of many activities the user can engage in, and is opened in a separate window. After the user navigates away from the browser, the window is closed, and a new window is created each ti...

WPF Controls disappearing in Windows 7?

We have a system built using WPF and have (until recently) been developing using Visual Studio 2008 SP1 and Windows XP SP3. We have upgraded some of our development boxes to windows 7 and we have discovered we are getting some unexpected behaviour when running our applications. Some controls do not display at all. Has anybody else exp...

WPF: Binding a ItemsSource to a Directory

I'm trying to do my first WPF project, and I've started with this sample project for image display. Part of it is the XAML that binds a Listbox to an Array of images: <ListBox.ItemsSource> <x:Array Type="{x:Type ImageSource}"> <ImageSource>http://static.flickr.com/34/70703587_b35cf6d9eb.jpg&lt;/ImageSource&gt; <Image...