wpf

Threading practices. Modelling application

Hi, all. There is the situation - i made some math modelling app on C#(WPF), showing it's results in realtime vector graphics. Math is doing fine (iterative process, per frame drawing), but there is the problem - while i'm using additional thread to do calculations, to draw result is should use Dispatcher.BeginInvoke (each frame!) which ...

What is the difference between a plain WPF app and one that can run on Microsoft Surface?

Is there anything I need to add to my WPF application, so it can run on Microsoft Surface? Are there any samples with source code available? ...

StaticResource vs DynamicResource behaviour on Combobox.ItemsSource

I've noticed a behavior difference between static and dynamic resource on ComboBox.ItemsSource, when the ComboBox gets out the visual tree. in the static exemple the selected destination remains in the dynamic exemple, the underlying object gets a null value Binding seems OK, because when the comboboxes gets in focus, and have their ...

WPF, how to override an application wide style on textblocks on specific places

I have a style xaml resource dictionary which is added in Application.xaml. In that style file I specify that all textblocks should have the foreground white. The problem is that this will change the combobox items foreground to white in a usercontrol I have in the same application. I want the items to have a black foreground in all or o...

Use StaticResource in XAML root element

I want to use StaticResource in the root element of a xaml document. But MSDN says: Static resource references from within a resource dictionary must reference a resource that has already been defined lexically before the resource reference. Forward references cannot be resolved by a static resource reference. And this:...

Simple WPF formatting question

How can I prefix bound values in TextBlock controls in a StackPanel without using separate controls for the prefixes? E.g., let's say I have a dialog that uses a TreeView to display a list of books, with the top nodes being the title, and a set of subordinate nodes for the other book attributes (ISBN, Author, etc.). I have the binding ...

wpf static binding question

Ok guys, I have a serious problem with this. I have a static class with static properties providing some colors as a hex string: namespace com.myCom.Views { public static class MyColorTable { private const string _Hex0 = "#FFFFFFFF"; private const string _Hex1 = "#FFE5E5E5"; public static String Hex0 { get { r...

Are there any restrictions by number of dp/do per project?

Are there any restrictions by number of dependencyobjectsp/dependencyproperties per project? edited: or per process/domain? I'm interesting in any kind of limits. ...

Opposite of "always on top"

I want to set my application to be on desktop level, like Windows Gadgets. Is this possible to achieve? Thing is, i have borderless application I want to run on desktop. I tried to find the option, but I found only "always on top" which is opposite of what I want to achieve. ...

WPF datagrid question

Hi, Very simple question ... Can I use the WPF datagrid control in the same way I use a regular grid ? How can I do the following but using a WPF datagrid instead of using the standard Grid ? <Grid Width="542" Margin="0,12,0,0" HorizontalAlignment="Left"> <Grid.ColumnDefinitions> <ColumnDefinition Width="182" ...

Custom ProgressBar ControlTemplate

Hi All, I am having a little difficulty with a generic template for my extended progress control. Basically, the template consists of a grid, with some text information and the actual progress bar. It works fine, except for when I want to switch to vertical orientation. Everything appears to be rotated correctly, but I get no progres...

WPF Toolkit - February 2010 Release

Hi All, I'm trying to install the new release of the WPFToolkit, no success... iv'e followed the instructions at codeplex - first uninstall the previous version and then install the new one, but still, after i reference the new version, i get to use the previous. Any ideas? ...

Entity Framework : Entity from a View

in my database a have an invoice table and a payment table. i have a transactions view that shows payments and invoices. i created an entity from that transaction view. in my application i want to be able to add a payment from the transaction screen (which is a datagrid of transaction entities) and that the list of transactions be updat...

WPF datagrid binding

Hi, I have the following domain: public class FileInformation { public String FileName; public String CreatedBy; // name of user who created the file public String CreatedComments; public String CreatedDate; public String EditedBy; // name of user who last edited the file public String EditedComments; public String EditedDate...

Keeping keyboard focus on a single control while still beeing able to use a ListBox

Working on a TouchScreen application which also has a keyboard attached, I have the following problem: The WPF window has a TextBox, which should receive ALL keyboard input. There are also Buttons and a ListBox, which are solely used by the TouchScreen(=Mouse). A very simple example looks like this: <Window x:Class="KeyboardFocusTest....

How display encrypted image using BitmapImage

I'm using BitmapImage as Source to an Image control in WPF. BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.CacheOption = BitmapCacheOption.OnLoad; bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache; bi.UriSource = new Uri(strFilePath); bi.EndInit(); return bi; Now I've encrypted this image and planning to use this encrypt...

sorting elements in a stackpanel WPF

I have a stackpanel with some usercontrols that are added or removed during runtime. These elements have an index that i assign to them when i new them, I need to keep these elements sorted by that index so i wote a quicksort function that sorts them based on the index but on the line that does the swapping y = items[i]; //y ...

Converting WPF application to Silverlight with use of Access database

Hey, I was wondering if it is possible to convert a wpf application to silverlight without days of work. Yes, i know there's a similar post, but dates from 2008, so outdated according to me because of the fast progress in silverlight. i have a wpf application that uses a 2003 access database (orders :)) and my client wants a silverlig...

Detect framework version 3.5

I'm developing an XBAP (Partial trust) application, with multiple (~100) users. In the next version the prerequisites have been bumped from framework 3.0 to framework 3.5, and we need an easy way to detect the framework version of each client machine, and advise them on whether they need to upgrade or not. Any ideas or suggestions on ...

How to insert inline content from one FlowDocument into another?

I'm building an application that needs to allow a user to insert text from one RichTextBox at the current caret position in another one. I spent a lot of time screwing around with the FlowDocument's object model before running across this technique - source and target are both FlowDocuments: using (MemoryStream ms = new MemoryStream())...