wpf

Changing from WPF User Control to Window?

I've been working on a commandline application, and have recently decided to add a wpf window to the application. I added this as a UserControl, however I noticed I can't call this class using ShowDialog() from my main code; I've tried changing the Base class from a UserControl to Window, however an error occurs; public partial class ...

Search and Highlight search text in items in the Listview in WPF

Hi, I am using MVVM to show the database records in a gridview (ListView view). i have a textbox where we can enter the text to be searched in the results listed in the gridview. i tried many ways to highlight the search text (Not the entire row only the text matches in the record) in the records displayed in the list view but unable to...

WPF - Event procedure updates a ListBox DataContext?

This whole question is for WPF C#. I have a class that has an event procedure that can fire at any time. The event procedure contains some text data that I need to display in a listbox. What is the best practice for making sure that the DataContext of the listbox is updated accurately as the event procedure fires? ...

Binding scattered/overlapping images to a WPF Canvas

I am porting a GDI application over to WPF, where I displayed several dozen images onto Form, then drew polygons, circles, rectangles, etc over the top of these images using GDI Pens and Brushes. I'm starting to get the hang of WPF binding and would like to store all of these images and markup graphics in my ViewModel. My VM contains a...

C# Script version of PyBinding for WPF

I wrote a CSharpScriptBinding roughly equivalent to the PyBinding on CodePlex. It uses the C# script engine from http://www.csscript.net. After I wrote it, I kind of decided it might not really be something good to use. Although it caches the compiled script code as an already compiled Assembly, my concern is that I will have one temp...

WPF - Extend ListView with checkable AND selectable ListViewItems

Hi there. I already read many examples on extending ListViews with checkboxes bound with IsSelected. But I want something more. I want a seperation between the checked and selected state, so i get a ListBox that has a single selected item, but can have multiple checked items. Unfortunately ListViewItem does not have a property for check...

in wpf datagrid can I update a cell value in a row as i type in another cell in another row?

in a wpf datagrid, if we have 2 rows. and each have 2 columns ... in the following format A, B, C, D are text columns row1: A B row2: C D when ever i type value in A, I want to change value in D and continue typing in A Thank you in advance for your ideas ...

How can I disable the F4 key from showing the items in a ComboBox

You might not know this, but pressing the F4 key on a ComboBox makes it's drop-down item list appear. I believe this is the default behavior on Windows. Does anyone know how to override this behavior in WPF (C#)? I know that overriding default behavior is generally seen as bad practice, however in this case I have a rugged-device that...

WPF Listbox with checkboxes appearing blank, added dynamically

I'm trying to populate a listbox with a series checkbox entries, however once running the code below the listbox has blank entries in it, which are selectable, i.e. a blue bar appears. However neither the text or checkbox appears. for (int num = 1; num <= 10; num++) { CheckBox checkBox = new CheckBox(); checkBox.Text = "sheet" + ...

ItemsControl and Focus Issue

I have an ItemsControl which is giving me issues. It has a DataTemplate, which contains a TextBox that is bound to a property in the code-behind. When I press the Enter key, a new element is inserted into the property. After this happens, the focus of the item in the datatemplate should shift down one item in the ItemsControl (done pr...

Binding collection indexes to a WPF DataGrid at runtime

After trying to develop our own control to display a table of data we stumbled on the WPF toolkit DataGrid and thought we were saved. A couple hours later I'm scratching my head trying to figure out if it can do what we really want it to do. The DataGrid seems to be based on displaying various properties of a single object, where I thi...

What is the difference between Visual Studio and Expression Studio?

I have visual Studio 2008. I have noticed that I cam make WPF applications with Visual Studio. Does this mean that it can do the work that Expression Studio does? I am going to install Visual Studio 2010. Does this do away with the necessity of Expression Studio? ...

Are Visio-Like WPF GUI's possible?

I want to create buttons and displays in WPF that look something like the Visio Flow Chart displays. Are there classes for that? ...

ExceptionPolicy.HandleException does not install Event Source for Logging in Registry if XBAP run outside debugger

I am using the Logging Application Block (of Microsoft Enterprise Library) to log exceptions in the Event Viewer that occur in my WPF XBAP application. If I run the XBAP in the debugger from Visual Studio, an Event Source entry for my application is automatically created in the Registry at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSe...

XAML Multi-Level Binding Source/Path Issue

So I have this issue I've been trying various ways to tackle all day and nothing's catching and working for it. Basically I have a XAML object called ChromeWindow (derived from Window) which has in it's code-behind a DependencyProperty called AppChrome which stores a reference to an associated ApplicationChrome XAML object (derived from ...

Grid view w/ progress bars?

Trying to decide on the best element to use for a grid view, pretty much exactly like the one you'd see in uTorrent or any other upload/download client. Specifically, I want to have a 'progress' column too (with progress bars). Using VS2010/.NET4. Haven't really started the project yet, so either WPF or WinForms are fine. What would you ...

Determine the width of the vertical scroll bar in a ScrollViewer

I'm using a ScrollViewer to display an Image. The Image has a ScaleTransform set as one of it's LayoutTransforms. I've got it setup to fit the width of the image into the ActualSize of the ScrollViewer. My problem is that if the image height requires the vertical scrollbar to be present (I have it set to Auto) then my image is scaled ...

How to set ItemsSource?

This dialog makes no sense to me And I'm having trouble finding good tutorials on it. Most of the examples aren't detailed enough, or do stuff via code, but I'd like to take advantage of the IDE as much as possible. Whats the difference between ItemsSource and DataContext? I'd like to bind it to just a List for starters. I don't nee...

WPF UserControls - setting the .Command property on button inside UserControl

I've got a UserControl that contains a button and some other controls: <UserControl> <StackPanel> <Button x:Name="button" /> ... </StackPanel> </UserControl> When I create a new instance of that control, I want to get at the Button's Command property: <my:GreatUserControl TheButton.Command="{Binding SomeCommandHere}"> <...

WPF XAML ComboBox Width

I have the following xaml with all the binding removed; <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Height="20"> <ComboBox x:Name="ddlDay" Width="30"/> If I set the width of the combobox to 200 it works but if I set it to 50 it doesn't size past the default. I'm kinda new to xaml so ...