wpf

Non breaking space in XAML vs. code

This works fine, and correctly inserts non-breaking spaces into the string: <TextBlock Text="Non&#160;Breaking&#160;Text&#160;Here"></TextBlock> But what I really need is to replace spaces with non-breaking spaces during data binding. So I wrote a simple value converter that replaces spaces with "&#160;". It does indeed replace spac...

Managing mandatory fields with triggers

I would like to set mandatory field backgrounds are red and others are green. So I try to implement below. But I could not control ValueConstraint Nullable property with trigger. Could you help please ? <Window x:Class="TriggerGirilmesigerekenalanlar.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmln...

WPF MenuItem Content "Name"...

Hi, I have a LOT of MenuItem(s), and I want to be able to change their "Content" so that it displays in the program. When I load up the program, their "Content Name" is set in a Setter I created.. but the only problem is that I have almost a hundred MenuItem objects, and I need their display names in the program to be different (not the...

Efficient pixel shader sum of all pixels

How can I efficiently calculate the sum of all pixels in an image, by using a HSLS pixel shader? I'm interested in Pixel Shader 2.0, that I could invoke as a WPF shader effect. ...

WPF canvas drawing with Graphics

Hi ! I'd like to ask if there is any possibility to draw on WPF Canvas with some kind of a Graphics type providing methods like: DrawLine, DrawPath etc.. (as it was in .NET 2). I know there's a lot of stuff like storyboards etc.. but I'm planning to do all the drawing in code behind and to have just 1 Canvas in WPF without any child ...

Conditionals in WPF.

I have the following question: I have a Boolean variable in a configuration file. If it is true I want a property in textbox control to be setup according to the value of that variable. Try the solution above but it does not work. What am I doing wrong? This is a fragment code: bool isKeyboardAvtive = true; //read from configuration fi...

WPF Databinding INofitfyPropertyChanged problem with nested types

We have a datasource that has a multiple nested classes. In general, there's a datastore which represetns a calendar year. It contains a collection of months, and each month contains a collection of days. Now, the problem is that we have a dozen or so properties that calculate total horus and what not for a month, half a year, and the en...

Problem Binding a ObservableCollection to a ListBox in WPF/MVVM

I'm working in some code , using wpf and starting to use mvvm. So far i have no problem, when i have one element and I have to show the values of it in the screen (binding of the specific name of the property). But now, i have to work with a property list , not knowing the names of it. So I created a class, named GClass, that only have t...

WPF Data Binding won't work

Hey, I have got an UserControll with a DependencyProperty called "Risikobewertung" whitch has the own Datatype "RisikoBewertung"(Datatype created by LINQ). So in my Controll I try to bind the Fields of RisikoBewertung to the TextBoxes on the Controll, but It won't work. I hope you can help me, and tell me why ;) Code: UserControl.xaml...

WPF - Apply a converter to all textboxes

Using WPF, I want to apply a converter within the binding of the Text property within all my TextBoxes. The following works for a single TextBox: <TextBox Style="{StaticResource TextBoxStyleBase2}" Text="{Binding Text, Converter={StaticResource MyConverter}}"> </TextBox> However, our T...

WPF MenuItem Content "Name"

Hi, I have a LOT of MenuItem(s), and I want to be able to change their "Content" so that it displays in the program. When I load up the program, their "Content Name" is set in a Setter I created.. but the only problem is that I have almost a hundred MenuItem objects, and I need their display names in the program to be different (not the...

WPF on a iX104 Tablet PC - efficient enough?

Hi, I'm considering to use WPF for an application running on an iX104 (unfortunately I don't have one of those yet). Do you guys think that this combination would be efficient enough? Or is WPF just to slow for such a machine, so better stick with WinForms? Relevant specs of the iX104: Intel Pentium U2500 CoreDuo 2x 1.2 GHz 1 GB RAM, ...

How could I implement a bleach bypass shader effect for WPF?

How could I implement a bleach bypass shader effect for WPF? I'm also interested in the possibility of implementing the first two Tehnicolor Film Processes, or any variety that would result in an old film look. ...

Projecting an object into a scene based on world coordinates only

I want to place a 3D image into a scene base on world/global coordinates. I have an image of a scene. The image was captures at some global coordinate (x1, y1, z1). I am given an object that needs to be placed into this scene based on its global coordinate (x2, y2, y3). This object needs to be projected into the scene accurately simi...

WPF - Render text in Viewport3D

I want to present up to 300 strings (just a few words) in a Viewport3D - fast! I want to render them on different Z positions and zoom in and out fluently. The ways I have found so far to render text in a Viewport3D: Put a TextBlock in a Viewport2DVisual3D. This guy's PlanarText class. The same guy's SolidText class. Create my own 2D ...

AdornedElement Properties in a Trigger

I have an Adorner in XAML that I'm using for ErrorValidation. Basically I have a grid that I want to display on two conditions (if the "AdornedElement" IsFocused or IsMouseOver). Below is a code snippet where I'm binding - successfully - to the IsFocused of the AdornedElement, but as you can tell that only solves 1/2 the conditions. N...

WPF Show wait cursor before application fully loads

I want to show the wait cursor before my WPF application, composed using CAL, fully loads. In the constructor of the main window, I have the following code: public MainWindow([Dependency] IUnityContainer container) { InitializeComponent(); C...

How to have a user control as a ListBoxItem

I want to bind a user control (View) to a ListBoxItem. The ListBox is bound to a collection of ViewModels. I have set the ListBox's ItemTemplate as so: <ListBox.ItemTemplate> <DataTemplate> <View:ContactView/> </DataTemplate> </ListBox.ItemTemplate> But all I get are blank ListBoxItems. I can click on the...

Effective Method to Manage and Search Through 100,000+ Objects Instantly? (C#)

I'm writing a media player for enthusiasts with large collections (over 100,000 tracks) and one of my main goals is speed in search. I would like to allow the user to perform a Google-esque search of their entire music collection based on these factors: Song Path and File Name Items in ID3 Tag (Title, Artist, Album, etc.) Lyrics What...

Delay KeyUp Action if User is Typing (C#)

I have a function that is being called when the user is typing in a search box. I want to wait for the user to finish typing before I actually execute the function. I know how to easily accomplish this in JavaScript with timeouts, but how would I go about doing the same thing in C#? Also, how long should I wait before I assume the user i...