wpf-controls

WPF: Animating in XAML, rather than C#?

.I am creating a user control that stacks three WPF month calendars (Master, Slave1, and Slave2) vertically. I want the second and third calendars to be hidden until the host window is large enough to show the entire month--no partial calendars. I have implemented the feature be trapping the SizeChanged event in an event handler in code-...

Free WPF Carousel Implementation

I have seen a lot of Carousels to show off WPF. I have never really need one before now though. Is there a decent free one? I have access to the Dev Express one, but I am making an open source project and would rather not put code in it that others cannot easily compile. ...

WPF - Get the ListBox row object from a button that is on the DataTemplate

I have a list box with a data template. The template has a button on it. When the button is clicked I want to do some logic with the object that is each row (in this cased an object called WorkItemTypeMappings). In the OnClick how can I go from the Button (object sender) to the object that is row that the button is on? Here is the XA...

Emerging MessageBox while processing data

Hello: I am working with C# and a WPF project. I created a button that, when clicked, process information that generally can last less than 3 minutes; during that time I would like to show a message box indicating: "This process will last less than 3 minutes, please wait", then when the process finishes I would like to supress the mess...

WPF: Setting named color to resource?

I am modifying the control template of the WPF Calendar control to change the color of text and the Previous and Next arrows on the control. I want to set the color to a local SolidColorBrush resource called MyTextBrush. The Previous and Next buttons have separate control templates, and each draws a Path object for its button's arrow. ...

ColumnDefinition doesn't expand until resize

Hi, I have a grid where one columnwidth is defined as *. The other columns are defined as Auto. The column with the *-definition contains a usercontrol derived from Panel that also implements IScrollInfo. During this control's MeasureOverride visibility is set to visible on a RepeatButton in another column (the RepeatButton's visibility ...

Creating graphics control in WPF and integrate to other winform application

Hello All, We have a existing applicaiton in winform .net. It has a form which displays a kind of flow chart diagram. Now we want to create a control which has enhanced graphics to display this flow chart. With my limited knowledge on wpf, is it possible - Create a graphics control in wpf which is display the flow chart Integrate this...

WPF: Binding a Color Resource?

I have an odd problem that's got me stumped. I am modifying the WPF Calendar control template, and for reasons that I explain below, I have to use a Color resource, rather than a SolidColorBrush resource, for my text color. Right now, my Color resource looks like this: <!-- My Colors --> <Color x:Key="MyTextColor">Blue</Color> Now I w...

How do I get the ActualWidth of the GridViewColumn

I have the following XAML: <GridView x:Key="myGridView"> <GridViewColumn CellTemplate="{StaticResource myTemplate}" /> </GridView> <DataTemplate x:Key="myTemplate"> <ContentPresenter Content="{Binding}" /> </DateTemplate> When I use it, I want the contentpresenter to have the same width as the GridViewColumn. So far, I've ...

WPF IsEditable ComboBox ErrorTemplate

Hello, I have a ComboBox with IsEditable="true". I'm trying to set an error template on the ComboBox. This is my error template that I have in my Window.Resources <ControlTemplate x:Key="error"> <Border BorderBrush="Red" BorderThickness="1"> <AdornedElementPlaceholder x:Name="adorner" /> <...

How do I bind element widths where "Auto" width behaviour is required?

I wish to have a set of elements have the same width, I can not simply put them in a grid as this is a content control and the elements being bound is unknown. As a simple example, how do I bind all widths of the first child of each stack panel together along with the second element. <StackPanel> <StackPanel Orientation="Horizo...

UI Automation on Custom Control: Need to use CTRL+TAB (tab focuses on first object)

I have a custom control that is derived from ListView. This list view uses a GridView with two columns (each templated appropriately): one column is the caption (just a label) and the other column is the control. When used, it looks like this: <l:CoolList> <TextBox l:CoolList.Caption="Name" Text={Binding Name} /> <TextBox l:C...

WPF: Collection dependency property "is read-only and cannot be set from markup"

I am creating a user control to display a three-month calendar. The control is based on the WPF Calendar control (WPF Toolkit 2009-06), and I want to pass several of the Calendar's properties through to corresponding properties of my user control. The user control properties are set up as Dependency Properties, and their underlying types...

Limit the number of rows displayed in Items control

Is there a way to limit the number of rows that get displayed in items control. ? I have a observable collection of strings which are bound to Items control. I want to limit the number of rows to display to only one. The collection can have more than one. Thanks, ...

ListBox selected index color wpf

I am just starting with WPF and I have this ListBox that displays an attribute from a class I made. I have to programmatically change the selected index, when I do something like: ListBox1.SelectedIndex = 4; the selected index is changed and highlighted gray, but if I click on it, the selected index is blue. Is there something els...

WPF - Item Mapping/Matching control

I am making a tool with WPF that involves matching items in two lists. Is there a cool control that can get me started on this? Basically, I would have a source list that I would want to allow to match with a destination list. Drag and drop would be nice, but I am open to anything at this point. Any ideas? All I got now is to make t...

Fast WPF Image Control

I'm looking for an Image control for WPF which can rapidly change images. The built in WPF one is quite slow for the image sizes im using (scaled). I only need about ~3 FPS. I have considered dropping to WinForms and even D3D but I'm not sure thats the best way. Can anyone suggest something? ...

What's the best way to prevent losing TextBox focus when there is a validation error?

I've messed around with PreviewLostKeyboardFocus which almost gets you there. I've seen a couple of implementations using LostFocus, but that just forces focus back on the TextBox after it's lost focus and you can easily see this shifting on the screen. Basically, I'm just looking for the same type of behavior you could get with using ...

how to extend WPF GridRow Contents into next row without expanding the current row.

Hello, I'm new to WPF and I'm trying to build a dropdown menu using the expander. Page layout is being handled with a Grid. The extender sits inside the first row of the grid and I would I would like the contents of the expander to expand over top of the contents of everything below when it's clicked. Unfortunately, right now, the ...

Cannot change Background color with triggers in XAML.

Hello, I have a little problem and I don't know how can I fix it ... I created a CustomControl called "StandardKeyView" from a Button. This control has a dependency property "DownImage" which is used to define a Background Image to my control during the mouse over. Here's the definition of the DownImage property : public SolidColorBr...