wpf

WPF global Controls color changes

Hi ! Suppose you want to override the Background / Foreground / TextSelection ... Colors for your WPF Controls. In my opinion, you need 2 things: Override the SystemColors in your Resources files Override the ControlTemplates (by adding additional Triggers etc.) The reason for this is, that some Controls in .NET 3.5 don't all...

Calling two different animations from the same click event

Hi Stackoverflow, I'm currently working on a Surface application where I need to call two different animations when a button is tapped. How exactly should I be doing this? I'd like to do it declaratively if it's possible. Should I be using MultiTriggers for this, or? Thanks in advance! ...

What is the best practice for WPF ValueConverter error handling?

Two function should be implemented, and I am wondering what type of validation I need to do on inputs and how to manage errors. Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConve...

Wpf treeview - i want to animate the expansion of the nodes

I have a databound treeview that i want to animate when the nodes are expanded. The animation should work vertically. Any ideas on how I could do that? ...

WPF Document Production Best Practices

I have a WPF application that captures various bits of information. At some point the user will need to generate a letter using a specified template and adding custom content. So far my application merges data capture with the document template (MS Word 2007) and launches the merged document so that the user can then print, save etc usin...

WPF: How to efficiently update an Image 30 times per second

Hello, I'm writing a WPF application that uses a component, and this component returns a pointer (IntPtr) to pixels of a bitmap (stride * height). I know in advance that the bitmap is a 24bits rgb, its width and height. Updating the Image control with these bitmaps makes up a video to the user, but I'm not sure what's the most efficient...

How to start a ColorAnimation from a MultiTrigger in a ControlTemplate ?

Hi all I have the following ControlTemplate for a WPF TabItem: <ControlTemplate x:Key="DefaultTabItemTemplate" TargetType="{x:Type TabItem}"> <ControlTemplate.Resources> <SolidColorBrush x:Key="UnselectedForegroundBrush" Color="#414141" /> <!-- Unique color for this template --> <SolidColorBrush x:Key="Selec...

WPF - ListBox ignores Style When ItemsSource is bound

Hi, I have created styled a ListBox in WPF so that it is rendered as a checkbox list. When I populate the ListBox's items manually, the styling works perfectly. However, when I instead bind the ItemsSource of the ListBox to a static resource (an ItemsControl containing the required items), the styling is completely dropped. Here's the...

ComboBox (w/ wrapping) binding/render problem

Below is the code to recreate the problem I'm having, the ComboBoxItems with TextBlock content, do not render correctly when bound to. Mousing over the ComboBox corrects the issue. So I have 2 questions. Why does the mouse over fix it? How do i have it correctly work with out the mouse over being required? MainWindow.xaml <Window x...

[WPF/MVVM] Dynamic animation using storyboards

Hello, I develop an application in WPF using the MVVM pattern. I am displaying an oriented graph, with nodes and links (see following picture). http://free0.hiboox.com/images/1110/diapo1c36a4b95802846b8553d2fe9b9e6639.png?26 The user can drag and drop the nodes from one "cell" to another. When the user drops a node, its position is ch...

WPF: Notify visualParent when its children changed their size

I have FrameworkElement, for example Grid, that has children(Cells, implemented in another control). When main Window changes size, i handle sizeChanged in Grid at first, and after that in some of its children. How can i get notify that all children sizeChanged events finished processing? Of course, i can raise other event in child sizeC...

WPF - play default windows sound when TextBox cannot recieve any more input

Hi, I'd like the default windows system sound to play when a user attempts to enter text into a WPF TextBox which has already reached it's MaxLength value. How is this possible? ...

WPF: Horizontal Alignment

Probably I'm just missing something obvious, but I can't get the image in my DataTemplate to align to the right in the Grid, so that when the window is stretched, the image is "pulled" to the right as well: <Window.Resources> <DataTemplate x:Key="PersonTemplate" DataType="Minimal.Client.Person"> <Border BorderBrush="Purple" ...

Pass Data to Data Template Selector

How do you guys pass the data (parameter) to DataTemplate Selector? The only one that I can think of is to use an attached property in DataTemplate Selector? Example: public class DisableWeekendsSelection : DataTemplateSelector { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFiel...

How to add custom-control-derived TabItem to TabControl in WPF?

I want to have my own base TabItem class and use other classes that derive from it. I define base class in MyNs namespace like this: public class MyCustomTab : TabItem { static MyCustomTab() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MyCustomTab), new FrameworkPropertyMetadata(typeof(TabItem))); } } And ...

WPF - Very basic ListBox.ItemTemplate Question

Ok, this is an embarassingly simple-looking problem, but is driving me crazy. I'm learning about DataTemplating and am trying to apply a very VERY simple ItemTemplate to a ListBox. However, when I run my app, the template is completely ignored and I just get the standard-looking listbox, whereas in fact I'd expect to see a list of check...

wpf - window to be tight round user control

Hi, I've got a user control that I'm loading into a Window dynamically - I wanted to set the Window so that it didn't have a size and then I thought the window to resize accordingly depending on the UserControl. However it dosn't - can anyone assist please? I've made a very basic example - I've cut out the dynamic bits and just put a ...

Find element feature

Hi, I want to write ie based web developer tool with find element feature. i am using c# and wpf and my application should looks like ie developer tool: or firebug: Any suggestion? ...

Get Child window using ProcessID or Window Handle?

Hi, My program A launched program B (both are separate exe's). Now my program B need to find if A have any modal/child window open using A's processID. Is there any way to do so? Thanks a lot for your help. ...

Reactive Framework ASP.NET MVC

Is it possible to apply reactive frame work in MVC application? or is it applicable for WPF? ...