wpf

Negative currency number XAML

Hi, I have a little problem with the current format of my negative currency number. Here's a screenshot resuming my situation. This is how I'm using the StringFormat in my binding. (BTW, I tried only {0:C}) As expected The current settings of my computer for the negative currency number 4. The result when I'm running my application ...

How as items listbox Horizontal Alignment Center?

A have listbox <ListBox> <ListBox.ItemTemplate> <DataTemplate> <DockPanel> <Button Content="{Binding name_trainer}" Tag="{Binding idPersonTrainer}" DockPanel.Dock="Top" HorizontalAlignment="Center"> </Button> </DockPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> ...

[WPF] Bind a Line position to the position of an element in a usercontrol

I have a canvas which contains specific usercontrols. At some point, I want to add a line to the canvas (in code) where one of the points is bound to the position of an element in a usercontrol. The usercontrol is dynamic, so elements can change position. The usercontrol contains a layout with grids, stackpanels etc. that the element c...

First item in databound ListView occasionally being duplicated?

I have a WPF (.Net 4) ListView used to navigate a local Windows directory. It displays the contents of the current directory, with name and size and all that. However, in some directories, the first element it displays shows up twice. For example, let's say in directory "D1" I have subdirectories "W", "X", "Y", and "Z". The ListView will...

WPF Binding Formatexception

Hi, In a C# Wpf application I have an XML Binded datasource. I want to update some xml like this: loop.Innerxml = "false" This value is binded (as a boolean) to a control. However when doing this, a formatexception comes up saying that a string is not a valid boolean (logical). However if the false is not entered as a string, I can't...

An Error Occurred While Downloading A Required File

Hi Guys. I'm not sure if this is the right forum or not, since I have no idea what's causing this problem. I have a WPF application that was compiled into a setup project. After building the setup project, there are two files: setup.exe and [Program Name].msi. I put both files in the same directory in an ASP.NET website, served via I...

Future desktop LOB apps - WPF, Silverlight or... HTML5?

The Silverlight strategy has shifted to Windows Phone, and for cross-platform web development, it's HTML 5. http://www.zdnet.com/blog/microsoft/microsoft-our-strategy-with-silverlight-has-shifted/7834 I'm just starting to get comfortable with the idea of developing desktop line-of-business apps with Silverlight out-of-browser (over WPF...

C# Problem setting Label Content in WPF App From Separate Thread

I have a window that contains a label (player1). I also have a class that gathers data asynchronously in the background inside a thread. When that data has been gathered, I want to changed the content of my label. Since the label was created by the UI and I'm trying to edit it from another thread, I tried using Dispatcher. However, after...

WPF: Bindings not working correctly

Say I have XAML like <TabControl Grid.Row="1" Grid.Column="2" ItemsSource="{Binding Tabs}" IsSynchronizedWithCurrentItem="True"> <TabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding TabTitle}" /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTem...

Wpf/SL charts - Pie tooltip

I want to set a toolTip on each of the data Points of the pie charts. I know how to do that, but as you can see in the attached picture, the toolTips look different according to the data points directions. Someone has an idea how can I do that ? ...

Ways to zoom in WPF

I Need to implement zoom same as in office 2010. The content can be any UI element including a third party grid(probably telerik) I know 4 ways to implement zoom. What the best way(performance) to implement zoom in this case? ...

Simple problem with OneWay Binding in WPF

Hi, I have simple class with one property, this class implements interface INotifyPropertyChange. public class SomeClass : INotifyPropertyChanged { private string _iD; public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(string info) { if (Prop...

WPF RichTextBox Control, How To Find All Italicized Words

How can you loop through all the "words" (spaces deliminate words) in an RTB (WPF Control) to see which ones are italicized? thanks ...

nipdf or nixps creates pdf with default page size

I have tried out nipdf from www.nipdf.com to convert a wpf visual to pdf. It works fine except one problem which i am not able to figure out. no matter how big or small my visual is, the pdf created is always the default page size (which is A4 in my case) . How can i make the page size to be the size of my visual ? ...

WPF semi cascading listbox

I have 3 controls on my page ListBox A ListBox B ComboBox C ListBox A is databound to a collection of items A ComboBox C is databound to a collection of items C ListBox B is databound to a collection of items B B has a reference to Item A and Item C, the ListBox B should only show the items where Item A is the selected item of Li...

'IDataErrorInfo' is a 'namespace' but is used like a 'type' - WPF

I try use IDataErrorInfo in WPF app on validation data, but if I try implement interface IDataErrorInfo in my class, I get this error: 'IDataErrorInfo' is a 'namespace' but is used like a 'type' I using namespace System.ComponentModel. Any advance. code is here: public partial class MainWindow : Window { public class Frien...

DispatcherTimer tick once

I basically want a dispatcher timer object to only execute once. So I have the basic code: DispatcherTimer dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0, 0, 4); dispatcherTimer.Start(); Then inside the click event: private void disp...

WPF Ivalueconverter empty values

Hi, I use a Ivalueconverter to convert a string to a boolean using an xml datasource. This works fine until I manually change the xml like so: myelement.InnerXml = "true" I then receive a formatexception saying the string is not a valid boolean, I check the value that goes in to my converter and it is equal to "" Here is my converter...

Search databinded listboxitem from XmlNode

Hi, I'm working on a c# wpf app in which I databind a listbox control to an xml datasource. Now I know that I can find the XmlNode that is linked to a listboxitem using datacontext. But now I want to go the other way around: Find the associated listboxitem when I have an xmlnode.. Any advice? ...

How to set a datatable to a WPF datagrid C#?

Hi guys. I'm new to c# so go easy. Basically I build a data table ( and I have verified it's not empty) but it doesn't seem to get displayed in my wpf datagrid... I used this example here and applied it:link text My datagrid remains blank. Does that example look fine to you guys? here is my code: XACML: <Window x:Class="WpfApplicat...