wpf

Free or Open Source Diagramming Component for Winforms

I need to be able to generate dependency diagrams programmatically. I'd like it to be able to generate a bunch of boxes with labels and connectors linking them, and ideally the component would position them automatically onto a design surface which could then be manually rearranged. I'm using Winforms and C# 2.0 (VS2005). EDIT: Howeve...

putting a debugging console window in your app

I'm starting to develop a simple application in VS9 and I decided to use WPF and the MVVM paradigm for it. Still being a bit unexperienced with VS deveopment in general and WPF-controls in peculiar, I would like to ask how I should proceed to establish a little debug console window that takes perhaps 1/4 of the main window and sits kind...

Implementing a WebCam on a WPF App using AForge.Net

Hi I'm writing an WPF application where I need to show a Webcam feed. I was able to do this easly with the AForge framework.But when I've changed from a computer to a another computer the same code doesn't work the same way. In the first one the webcam feed works perfectly, but in the other one this does't occur, the feed has a lot of...

Wpf Binding Stringformat to show only first character

Hi, Is there any way so that i can show only first character of a Bound string on a textblock..? For eg;If i Bind 'Male', my textblock should only show 'M'..... ...

Setting WPf Datagrid Combobox value to its respective textbox

I am having a textbox and a combobox as a template column. Below is XAML <wpfkit:DataGrid Margin="3" Style="{DynamicResource SimpleDataGrid}" FontWeight="Normal" MaxHeight="100" CanUserAddRows="True" ItemsSource="{Binding Source={StaticResource odpExistingGHSCodesColl}}" AutoGenerateColumns="False" Name="dgGHS" VerticalScrollBarVi...

Add parameter to Button click event

I have a wpf button like this: <Button Click="button1_Click" Height="23" Margin="0,0,5,0" Name="button1" Width="75">Initiate</Button> And I want to pass {Binding Code} passed as parameter to the button1_click handler. How do I go about this? Disclaimer: really new to WPF ...

WPF ListBox Scroll when item added

Hello, I have a WPF ListBox that is set to scroll horizontally. The ItemsSource is bound to an ObservableCollection in my ViewModel class. Every time a new item is added, I want the ListBox to scroll to the right so that the new item is viewable. The ListBox is defined in a DataTemplate, so I am unable to access the ListBox by name in m...

WPF: Why shouldn't I use {TemplateBinding Margin} in ControlTemplate - is Margin meant only for element's containers?

I have created my own ControlTemplate for Button, like this: <Style x:Key="LightButtonStyle" TargetType="{x:Type ButtonBase}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ButtonBase}"> <Border x:Name="WrappingBorder" Marg...

Why does BackgroundWorker_RunWorkerCompleted not update GUI?

I already searched the forum but no asked question fits to my problem I think ... I use a BackgroundWorker to handle a very time consuming operation. After this operation finishes a button should be set to enabled so that the user can perform another operation. I'm using WPF and I'm following the MVVM pattern, so I have no direct acce...

WPF Draw Text on window

Hi All, I found this link: http://msdn.microsoft.com/en-us/library/system.windows.media.formattedtext.aspx It is an example of how to draw text by overriding the OnRender method. I've overridden the OnRender method of the Window by using the following code, but the text is not visible. What I am doing wrong? protected override void O...

Accessing an ItemsControl item as it is added

In a previous post, I was advised to use a DataTemplate to render a group of Buttons and Labels, and it works wonderfully. The problem is that I have several of these groups of Buttons, and I would like to distinguish one group from another. I plan to use the AlternatingIndex to color each group differently, but that's not enough -- ea...

WPF: How can I avoid the flickering of the checked checkboxes in a ListBox or a ListView ?

How can I avoid the flickering of the checked checkboxes in a WPF ListBox or ListView ? It can be reproduced with the code below by clicking on the Refresh button or by scrolling the listbox. If IsChecked is false, it does not flicker. Window1.xaml: <Window x:Class="WpfApplication6.Window1" xmlns="http://schemas.microsoft.com/w...

wpf scrollbar glitch

I have a customized datagrid inside of a TabItem. The TabItem has a scrollbar. When I select an item in the datagrid, the tabitem/scrollbar view snaps to the top of the DataGrid. The datagrid selected event has an empty handler. which is a bummer because I can't find a cause in the code for the selection side effect i'm seeing--let alon...

WPF DataGrid - Dynamic Row Details via Code

I have the need to show RowDetails in the WPF DataGrid when the user performs an action outside of the grid. The thing is though, I need to be able to switch out exactly what the RowDetails will be based on that. For example, if the click Add, I want to show RowDetails below Row of type AddRowDetailControl, and if they choose Edit, I wo...

WPF TabControl Switch behaviour

Hi, I have a tabcontrol which binds to an observable collection of tabs. The tabcontrol always has the first tab which hosts a listview bound to another observable collection. On selecting an item in that list view a new tab is created an focus given to it. The problem I am having is: When I switch back to the first tab there is a...

WPF application crash...

I am working on a WPF application with a TabControl (3 tabs with textBlocks, labels and dataGrids). The application auto-refreshes the data on these tabs using background threads. Everything works great except for the fact that if I switch tabs when one of the background processes fires, it throws an "Object reference not set to the in...

How do I Filter ListView in WPF?

I have a ListView bound to a collection of items. I do not want to show the items where the property IsDeleted = "1". How can I accomplish this? ...

WPF - Floating Toolbar

Hi, How can I make a floating toolbar (like the mini font floating toolbar in Word 2007) using WPF? I would like it to appear and disappear from mouse movement over items. Thanks Q ...

WPF ListBox insert

I have a WPF Listbox defined in a DataTemplate that has its ItemsSource bound to an ObservableCollection. When new items are added to the collection, I want the ListBox to work in "insert mode", always adding to the front of the list, not the default append mode. How do I make the ListBox use the insert mode when not adding to it directl...

Causing Row Selection in custom Row Template - MS WPF DataGrid

I have a custom row template to show some data, and it doesn't use a SelectiveScrollingGrid in its' template. I don't mind handling the events on my outer elements, but I can't seem to figure out how to cause a "Select" behavior. Typically I've been causing it by raising the MouseLeftButtonDownEvent on the active DataGridCell, but now th...