wpf

Reversing ListBox items (descending sort by "nothing")

Is it possible to sort items in WPF ListBox in reverse from their original order? I mean you can use SortDescriptions to sort by some property, but what if I just need to show the items in the reverse order with no real field to sort against? Note: I would prefer not to sort the original collection or clone it, etc. I know how to do tha...

Will SQLite Work in a ClickOnce Deployment?

And if it will, what is the best practice in terms of connection strings? Just a relative path? |DataDirectory| ? ...

How to connect Themes/Generic.xaml to window1.xaml?

I have the following button style in Themes/Generic.xaml and I want it to apply to buttons everywhere in my WPF application. How do I connect it to my window1.xaml for instance? <Style TargetType="{x:Type Button}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Sette...

WPF: How to handle errors with a BackgroundWorker

I am a bit of a newbie when it comes to windows client programming. I have a background worker that has a DoWork event and a RunCompleted event wired up. If an exception gets thrown in DoWork, I want to make changes to my UI, however, I cant because it is in a different thread. I can communicate the error to RunCompleted, but that doesn'...

Insert Image in WPF RichTextBox

Hi there im using the following code for insert text and images, but I want to insert the image "behind text" as Image>Adjust with Text property in MSWord { int numeroInforme = Convert.ToInt32(txtNroInforme.Text); List<informeMedico> lstInformes = getInformeMedico(numeroInforme); FlowDocument mcFlow...

Disabling search in a WPF FlowDocument

Hi, I have a FlowDocument that is defined in XAML like this; <FlowDocumentScrollViewer> <FlowDocument> <Paragraph> <Run>Hello</Run> </Paragraph> </FlowDocument> </FlowDocumentScrollViewer> What I'd like to do is prevent the Find and Zoom controls from appearing when you press Ctrl-F or F3. Is this...

Why do I have to explicitly set the ItemsSource of a ListView to null before setting it to a new value?

In a particular situation - there is too much code to publish on here - when I try to bind a generic List collection to the ItemsSource of a ListView, nothing happens. The ListView has been bound to a different collection previously. If I set the ListView ItemsSource to null, then the new binding works. I tried to isolate the problem bu...

How do I make a RadioButton's Bullet align top?

I have a multiline radio button and I want the bullet to be to the left of the content (as default) aligned to the top of the radio button control. What's the easiest way to do this in XAML? ...

.NET client vs. ActiveX (or another approach?)

Does anyone have any white papers or articles that would compare and contrast a web architecture where a .NET client component is required and the options being considered are ActiveX or a .Net component solution? I have a customer that wants to architecturally recommend a .Net client approach over Active X. However, there are some st...

How do I "Stick" a shape to the mouse in WPF?

I have a wpf application that has some shapes on a canvas I want to allow the user to click on a shape and then the shape gets stuck the the mouse until they click again. So far I know very little about WPF so go easy on me ;) ...

Migrating from WinForms to WPF... was it worth it?

I also have a desktop application in WinForms that is a middling size (a couple dozen major forms backed by 46 tables in the database). I'm thinking about rewriting the UI in WPF, but before I go there I was curious if there were any war stories about doing such a conversion. I use LLBLGen to generate my low level data access objects, a...

WPF Edit Mask

What is the easiest way to specify an edit mask in WPF for a simple Text Box? e.g. one that transforms 10000 to 10,000 as you type. ...

Good example WPF applications

I'm just starting to learn WPF and am interested in seeing some sample applications. These can either be applications written entirely for showcasing WPF features, or real-world applications written in WPF. Obviously the source code would need to be available. Does anyone have any suggestions? ...

Math (in WPF): Getting new x,y coordinates after a translation

With reference to this programming game I am currently building. I am using WPF to animate canvases, and I am using the BeginAnimation method to translate (move) a canvas across another canvas. With the BeginAnimation, I need to specify the From and To coordinates for both x and y, and this is the method I am using this like such: //X...

How do I invert BooleanToVisibilityConverter?

Hi, I'm using a BooleanToVisibilityConverter in WPF to bind the Visibility property of a control to a boolean. This works fine, but I'd like one of the controls to hide if the boolean is true, and show if it's false. Is this possible? Thanks, Andy ...

Does a WPF .NET 3.0 Date Picker exist?

I am trying to find a WPF 3.0 date picker control. What can you recommend and where is it? ...

Is my ItemsSource syntax ok?

I have the following XAML. Let's say FruitList is a collection of Fruits, each of which has a collection of FruitSeeds. Is there a syntax to bind cbxFruitSeeds to a collection of FruitSeeds, depending on which Fruit is selected in cbxFruits? <GridView> <GridViewColumn Header="Fruits"> <GridViewColumn.CellTemplate> ...

WPF Triggers

Hi, I'm trying to set a trigger to display a block of text when the value i get for the cell is a certain type. I have successfully managed to display an image in the same situation, but in this circumstance i don't want an image, but some text. Have commented out lines in order to test.try to make it work. The commented out code work...

Using a custom WPF control in WinForms

I'm going to have to build a custom control for a WinForms application. But in the near future that same control will have to be used in a WPF application. I've already written all the logic in a controller class which I can use for both WinForms and WPF (I will only have some databinding to do and that's it), but of course it would be ...

Inverse DataTrigger?

I can trigger property settings on my ListBoxItem template based on properties of underlying data object using DataTrigger with something like this <DataTrigger Binding="{Binding Path=IsMouseOver}" Value="true"> <Setter TargetName="ItemText" Property="TextBlock.TextDecorations" Value="Underline"> </Setter> </DataTrigger> But what ...