wpf-controls

WPF Custom Control with Item/Data Templates

I know how to create a custom user control in WPF but how can I make it so that someone can provide an ItemTemplate? I have a user control that is a mixture of several other WPF controls, one of them being a ListBox. I'd like to let the user of the control specify the content of the list box but I'm not sure how to pass that information...

WPF User Control's DataContext is Null

I have a user control where the XAML of the control can bind to the appropriate properties from the parent's data context like normal (the data context propagates in xaml). For example, I have a window whose DataContext I am setting to ObjectA for example. My user control within the window is then try to access the properties within th...

WrapPanel and first line

I have items wrapped in wrap panel. I want to move first line of items down by some offset. Is it possible? Thanks ...

Is there a WPF ListBox equivalent to Windows Forms Listbox TopIndex?

Basically what I want to do is allow a user to type in a string value and have the list box scroll to the item that matches the text they have typed (or the first LIKE match). If I use the .ScrollIntoView() method, the problem is that it puts the item at teh bottom of the visible area if the item is further down in the list than the cur...

Setting DependencyProperty on child of WPF composite control

This is working in WPF documents, but I am thinking this is not restricted to that scope and applies at least to all WPF custom controls. I have a custom, composite, inline control in a WPF document. My control inherits from Span and has a custom Run control as a child. Public Class MyTextInput Inherits Span Private mInnerRun As Bind...

How to make a Template Window in WPF?

So i am building an application that will have lots of windows, all with the same basic layout: A main Window A logo in the top corner A title block A status displayer down the bottom An area for window specific controls. At the moment i have to recreate this structure in every window. Ideally i want this layout to be coded in a sing...

OnItemChanged not called when trying to implement VirtualizingPanel in WPF

Hello I'm trying to implement my own VirtualWrapPanel in WPF. I implement it this way : public class VirtualWrapPanel : VirtualizingPanel, IScrollInfo { .... protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args) { switch (args.Action) { case...

What to do when WPF Window doesn't recognize user control defined in the same project?

I have a window "Operation" in XAML that uses a user control "Status" defined in the same project. When I build the solution, it returns ok, but when I open the design view for the Window, visual studio says "Could not create an instance of type 'Status'. The XAML for the Window "Operation" is below: <Window x:Class="TCI.Indexer.UI.Ope...

How do I add horizontal margins to my WPF TabItems without cutting off the tab?

My TabItems before attempting to apply a left margin of 10 look like: After attempting to apply the left margin of 10 to the blue tab, the blue tab gets cut off like: How do I do this properly? ...

How to stretch in width a WPF user control to its window?

I have a Window with my user control and I would like to make usercontrol width equals window width. How to do that? The user control is a horizontal menu and contains a grid with three columns: <ColumnDefinition Name="LeftSideMenu" Width="433"/> <ColumnDefinition Name="Middle" Width="*"/> <ColumnDefinition Name="RightSideMenu" Width="...

Multi-column Tree-View in WPF

Anyone know where I can get a control like this? Thanks! ...

What is the Best WPF Ribbon Control Suite?

I'm going to add a WPF Ribbon UI to my program. What is the best suite of WPF controls including a ribbon control, based on your experiences? Thanks! ...

How to bind in WPF a whole object to an user control?

People use frequently something like: <ListBox ItemsSource="{Binding ElementName=thisControl, Path=ListIndexes}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Label Content="{Binding Path=IndexName}"/> <Label Content="{Binding Path=IndexValue}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> But I would like ...

What's the easiest way to create a WPF progress bar without the dashed style?

I'm looking to create a progress bar that doesn't use the WPF default style, which uses a dashed display. All I want is a simple, "smooth style" progress bar. In other words, I don't want to progress bar to be dashed. I want it to use a solid colored bar. What's the easiest way to do this? I assumed this would be part of the default...

Where can I find a free masked TextBox in WPF?

Do you know any freely available WPF component for using masks (regex) in textbox? ...

How can I prevent the VS WPF designer putting margins on every object from the toolbox

When I drag a control from the toolbox on to the Visual Studio 2008 WPF design surface, it sets a margin based on where I dropped it and a default size. Is there any way to prevent VS setting those? When I drop a control on a stackpanel I want it to flow in to the existing controls in the panel. Thanks! ...

Is there any native WPF Multiselect combobox available ?

Even a 3rd party one will do. Thanks ...

Force a custom WPF Control to resize correctly

I have written a WPF user control and part of it involves dynamically adding elements to a canvas which effects the height of said canvas. The canvas is nested within a grid. When I dynamically add my elements the height of the canvas changes, but the canvas ends up extending beyond the edge of the overall control rather than causing the...

Setting Culture / Language in RichTextBox WPF

Hi there is possible to set a default language or set a new one in RichTextBox, i want to set it in "es-PE" for spellchecker propouses Thanks! ...

Removing an item from a listbox leaves the listbox with no selected item

Hi I have a WPF listbox, with some custom item inside. When user wants to deleta on of the item, what happens is that he has to reselect manually in the list rigth after delete because the list "seems" to lose focus OR no selected item exists. Any idea ? Thanks Jonathan ...