wpf

Different sized vertical cell widths in a WPF Datagrid control

I have a collection of Person objects that I want to display in a WPF Datagrid. The class definition for Person is: class Person { string Name; int Age; List<string> FavoriteFoods; } I want to display a collection of Persons in a table. Because a person can have multiple favorite foods, I want all those favorite foods in a singl...

WPF - How to load text in a text-block into multiple controls upon click

Hi all, I've this requirement where: For example, a textblock has a name displayed as "Lastname, Firstname" which upon click will load two textbox controls with Firstname's value loaded into its own box and lastname's value into its own box and keep them ready for editing. While I can easily write a bunch of if conditions in my code-beh...

WPF TextBox won't update source

I'm trying to make a simple form that contains textboxes that draw from a db in my project. I'm using the table adapter's GetData() method in the xsd file to populate the data context. I want to update one of these textboxes and have the changes reflected in the database. The textboxes populate fine, but the changes don't make it back to...

Apply Control Template in XAML

This should be really simple. How do I apply a ControlTemplate to a Thumb in XAML? <UserControl.Resources> <ControlTemplate x:Key="temp"> <Ellipse Width="60" Height="30" Fill="Black"/> </ControlTemplate> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <TextBlock>Not Dragged</TextBlock> <Ca...

Add carriage return to string resource in WPF

My applications store all localized text in a string resource dictionary as suggested here http://msdn.microsoft.com/en-us/library/bb295251(VS.85).aspx <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:S...

How do I not specify a theme for WPF and use the host OS theme?

Is there a way to not specify a theme at all for WPF and just let it default to what the OS is using? I am still partial to Winforms for this reason. WinForm apps feel professional, light on its feet and part of the operating system, whereas as WPF application, including VS 2010, feel heavy. Moreover, WPF applications are visually inco...

VS2010 Workflow Design Surface Inoperative

I am using VS2010 and having an issue where upon opening my solution the Workflow.xamlx does not appear to render correctly. The activities on the design surface only get drawn for the area that is initially visible when the xamlx loads. To demonstrate the problem, I see the following. (I apologize for the blur) The first problem is...

Is it possible to databind directly from a linq query result to a control?

I have just started using WPF and am having trouble data binding from the result of a Linq query to a ListView. I have tried a number of combinations including setting the DataContext and ItemsSource to the query. As in: listView.DataContext = (from person in People select person).ToList(); Then in the xaml setting the DisplayMemberB...

Josh smith MVVM Pattern Big problem

I'm create project using Josh Smith THE MODEL-VIEW-VIEWMODEL (MVVM) DESIGN PATTER FOR WPF But has one problem. Same workspace shown same operation. My VIEW contains tabcontrol. after creating 2 or more same workspace,when i changing selected index for tabcontrol from any workspace, other same workspace tabcontrol shown same result. I'...

Cinch version of ViewModel command to close a View

Without wanting to bug sacha too much, does anyone know what the Cinch V2 way of closing a View from a ViewModel command? Previously I have used a RelayCommand in the ViewModel base to accept the Escape keybinding command action and wired up a RequestClose event in the View code behind to do this. ...

Updating an Observable Collection Based on a combobox selection...

So I have an ObservableCollection of items called "Class1" and Class1 has a property named "ID". I use a datagrid from the WPFToolkit and bind to this collection. Within the datagrid is a combobox column and I bind it's ItemsSource to the ID property of the class. At this point, all is good and everything populates as it should. What ...

How to update Frame source from two listboxes on selected item value???

Hi, I hope to find an answer on how to achieve functionality I am trying to have. I have two listboxes. I generate content for them from XML. I also define UriSources in XML. I'd like to find out how to achieve a navigation by clicking any listbox item in any listbox. As a result, I need to be able to update Frame's Source property from...

WPF ListView selection cannot be cleared on load?

I looked at several related answers, and determined that I can programmatically clear the selection by setting lstData.SelectedIndex = -1; However, when I do it right after setting the data context on startup, somehow it never works and gets set to select the first element in the list. I also tried adding the setting to the XAML, and -1...

Can I bind multiple controls with single class?

I have one class named investmentdetails. I created two different controls for displaying separate data (properties) from same class. Is it possible? If yes then how? ...

How do I make a CheckBox look like a RadioButton

I wanna use a CheckBox but I want it to have the RadioButton chrome. What's the easiest way to do this? ...

visibility binding with converter and no path

Visibility="{Binding, Converter={StaticResource nVis}}" My converter return collapsed if object is nothing and visible if not. Why the error : Erreur 1 Erreur de génération inconnue, 'MC3045 : propriété 'Converter' inconnue pour le type 'MS.Internal.Markup.MarkupExtensionParser+UnknownMarkupExtension' rencontrée lors de l'analyse d...

How to implement Wpf Combo box Validation

Hi everyone, During one of my project i need to add required field validation on the combo box of wpf application. in our process we are generating a form depending on the condition. after the form is generate and all of controls are rendered we need to implement the validation rule for the controls like for required text box i need to ...

Focus on a WPF TextBox doesn not work properly with attached properties

In WPF MVVM environment, I'm trying to ensure that focus is given to a TextBox. What happens is that the Cursor appears in the TextBox but is not flashing and the TextBox does not have focus. The code is: I have a Popup containing this UserControl: <UserControl x:Class="Rendevous.BusinessModules.AdministrationModule.LogonView" ...

Is there a style library for text formation in WPF application?

I'm thinking of the set of styles to format text (Office 2010 style, Office 2003 style, v.v.. ); each set contains of smaller styles (header 1, header 2, title, ...) Is there a similar "thing" to use for WPF/Silverlight application? ...

Is it possible to have timeline marker / add image to the slider in WPF using Blend?

I have research on my question but it seem like only silverlight have timeline marker.. I want to show the user when is the next part of the video going to start at on the video slider but I really got no idea how to do it. Or is it possible to add images near the slider, to show user where/when will be the next video parts going to star...