wpf-controls

Creating resizable WPF control using XAML

I want to create a WPF control that contains elements (rectangles and ellipses) that scale and align as the container resizes. As an example, if an ellipse is set to align horizontally to the right, it always stays on the right. As the container is vertically resized, so do the child elements. I've been looking at control tutorials fo...

How to assign the selectedItem of a WPF combo box to a variable

Hello all, I am hoping you can help me unravel an issue I am having with the use of a combo box. Within my project I need to consume values from one collection and have these items display within my combobox . At this time I have built an observable collection that simply contains different involvement types public ObservableCollection...

Using behind code and ContentTemplateSelector causing problems

I have contentTemplateSelector that I use to display different datatemplates that contain usercontrols. I have a combobox that i use to trigger the event. When a user select a comboboxitem I use the TAG to inform the contentTemplateSelector what user control is being initialized. case (int)AlertCodeTriggerEnum.AlertEvent: mEventCont...

WPF ListView with "readonly" SelectedItems

Here's my situation: I've a many-to-many relationship I'm trying to model in a WPF app, while editing one side of the relationship. The situation is I've a set of users that belong to zero to many groups. While editing a user, I use a ListView with SelectionMode set to Many. Groups that the user belongs to are marked as selected items in...

incuding non data elements into a WPF databound combo box

I've been working with two different combo boxes within my solution ( Department and Name) these combo boxes are currently bound to a list collection that is being returned from an external service reference. Where I have a question is in that I need to insert other elements into the combo box other than what is being provided by the API...

Developing and deploying SurfaceScrollViewer

I'm having a hard time finding the correct information on this. I've been using WPF for my applications because of the enhanced visuals you can achieve with it. Right now my controls are basic WPF controls (ListView, ComboBox, etc.) and are scrolled using the basic Windows methods (Scrollbar, Scroll buttons), which is not touchscreen f...

Anyone used "DotNetBar for WPF" by DevComponents?

Has anyone had any experience of using the controls in the "DotNetBar for WPF" component suite by DevComponents? Good control suite? Good company? What is their support like? ...

Which WPF control suite is best suited to MVVM?

It seems that the only way to really evaluate a UI control suite is to download the trial and invest many hours in understanding its limitations and design flaws. However, with so many to choose from, I am trying to shorten this process by ruling out those that fail to meet a key criterion - MVVM compatibility. What are your experiences...

How do I make a multiple stacks of controls (columns) scrollable?

Hi, so I'm new to using WPF and can't figure out how to make an easy way to have multiple columns of controls that can be added / subtracted easily and still have it scrollable. So for example (my situation), I have two text boxes and a button that need to be added for however many "items" there are. I would want these together in a 3 co...

How to get datagrid to show in toolbox

Hi, I am new to wfp and am looking for the datagrid tool, how do I add it to the toolbox. I have checked in the options and it all appears checked etc. Thanks, R. ...

WPF, animate over container boundaries

Hi, I'm learning WPF and have a specific goal. Imagine you have a grid (3 rows by 3 columns), and a control, say a simple blue rectangle fills the middle cell. When I click on the cell I want the square to rotate smoothly through 180 degrees. The specific issue I have at the moment is; as the rectangle rotates, it won't change its ...

WPF ControlTemplate Expander issue

The following control template code (from generic.xaml) gives me an error, 'The attached property ControlTemplate.Triggers' is not defined on 'Grid' or one of its base classes. Any help is appreciated. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winf...

TabControl.Items.Remove(TabItem) does not free memory used by TabItem

I am having a WPF application where when I close a TabItem from TabControl using TabControl.Items.Remove(TabItem) does not free memory used by TabItem. It just makes TabItem invisible and TabItem object still remains in the memory. Is there any way to remove this TabItem object from memory ? Any help would be appreciated. ...

How can I change the background of a Canvas in WPF during runtime?

My scenario is the following. I am creating a little math quiz application for my son and wanted to dynamically change the background ImageBrush of my canvas after each question is answered. I proceeded to embed my images (pngs) into a resource file and figured I would load them into an array and then randomly choose one and load it into...

WPF - Drawing a line of text with different background colors

I need to draw a line of text with that has a different background for part of the string (i.e. like a highlight) in WPF. The FomattedText class allows you to set various attributes for different parts of a string like bold, underline fore color etc but does not have background color. I think using TextFormatter and writing a custom Tex...

Emulating OwnerDraw controls in WPF

In the past, I developed a customized combo box in win forms which implements auto complete behavior where the matched portion of the text is highlighted in blue, whilst the rest of the string has the normal background color. In win forms this can be done fairly simply using OwerDraw mode. I need to do similar kinds of things for WPF con...

Setting XAML property value to user control

I have a user control in WPF which i want the text of one of it's labels to be read from the XAML where it is used. Hence.. My User Control: <UserControl x:Class="muc"> <Label Foreground="#FF7800" FontSize="20" FontWeight="Bold"> <Label.Content> <Binding ElementName="TestName" Path="." />...

[WPF] GridViewColumnHeader confusion

Why would that work: <Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Background" Value="LightBlue"/> </Style> And not this? <ListView.View> <GridView> <GridView.ColumnHeaderContainerStyle> <Style> <Setter Property="Background" Value="Orange" /> ...

Slider maximum minimum changed

Basically I need to do some calculations when the Maximum or Minimum properties change, but there's no event in the Slider control that allows me to look at it when this happens. Any ideas? Thanks! ...

Set focus on a control based on other control's event in WPF

Hi, I would like to know how to set focus on a control based on the event of some other control in the same window. I want to do this at the XAML level. Consider the following example. <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Gr...