wpf

how to multiple times convert value in WPF

I have a 2 converter. Boolean to Visibility(Bool2Visible) - This converter convert Boolean value to Visibility enum Invert Boolean(InvertBool) - this converter invert Boolean value My xaml is here <stackpanel Name="A" visibility="{Binding isTrue,Converter={StaticResource Bool2Visible}}"/> <stackpanel Name="B" vi...

Wrap something around each item in an ItemsControl

Let's say I have a collection of objects of different classes. Each class has its UserControl DataTemplated in a resource file. Now I want to use ItemsControl to display the collection, but I want an Border or Expander around each item. I would expect something like this to work: <ItemsControl ItemsSource="{Binding MyObjects}"> <I...

Moving ListBoxItem Up/Down in WPF

I've created a listbox which contain filenames. I want to give user a option to move up and down file name using up/down button and using drag and drop. Anyone has an idea how to achieve this functionality. XAML Code: <ListBox Grid.Column="0" Name="listBox1" AllowDrop="True" Drop="listBox1_Drop" /> <StackPanel Grid...

Delete DataGrid row (WPF) by clicking Delete key button

Hi, I have WPF 4 desktop-based application. In one of the windows of this application I have DataGrid with data, binded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate with data I have delete button, that deletes selected row from DataGrid and call SaveChanges() method. Now I want to add support for keyb...

Creating a simple multi-user desktop application

I'm working on a simple mark management system for a school department (let's assume it's the Maths department). They want a simple system for users to enter marks for each student as they progress, entering marks for each term, getting yearly averages, sorting by teacher, etc. Speaking to the person in-charge of the department, he said...

WPF: Passing Button.Content as ConverterParameter

hi guys, say I have this Button markup: <Button Visibility={Binding Path=Mode, Converter{StaticResource VisibilityConverter}, ConverterParameter=<i want Button.Content here>} Where the Button.Content is something I want to put at the expression for ConverterParameter. It refers to the current Button's Content property. Thanks, any hel...

Find destination of a RoutedEvent

When I execute a routed command, let's say: ApplicationCommands.Undo.Execute(null, this); WPF does some magic to find the proper CommandBinding on which it executes the ExecutedRoutedEventHandler. Is there a way to get a reference to the CommandBinding (or at least to the handler) that would be executed? It would sometimes be nice...

DevExpress WPF grid bound to List<String> using MVVM

Hi All, I am trying to do something that should be simple, but think I am just not seeing the answer. I have a List with several strings. I would like to bind it to a DevExpress DXGrid. It appears that the grid is showing the correct number of row, but not displaying my text. I am using the MVVm patern and have seperated my ViewMode...

How do I access enviroment variables in a WPF Browser application

HI am interested in obtaining getting the Enviroment.UserName in a Wpf Browser application. But I have run into a SecurityException. What changes should I make obtain the enviroment variables. Update: the application is run on my company intranet. ...

Double click event in MVVM Foundation

I've seen several methods for handling this across several libraries but I wanted to know what is the best way to do this, specifically, with MVVM Foundation. I'm trying to capture double click for list item. Thanks! ...

WCF service with a version for QA and PROD

Here is my scenario...I have a WPF app that talks to a WCF service. The connection string settings are in the WCF service. The WCF service can be deployed to two different web sites, one for QA and one for PROD (each with its own URI). I want my WPF app to be able to be run using QA data or PROD data. Basically, I would pass a pa...

Show ComboBox on Datagrid row edit, WPF

Hi, I have a DataGrid with data in my WPF 4 desktop-based application. When user click twice on row DataGrid switches to edit mode, where user can change values of cell. Now I want that on specific cell user could only choose values from combobox, e.g. sex — mail/female and not to type something else. How can I show comboox on edit mod...

How to enter the URI to setup the ModuleCatalog in Prism WPF

I am getting a bit frustrated with prism. Something that should be so easy is really getting me stuck! I am trying to load my ModuleCatalog from a file. I created the ModuleCatalog.xaml file in my shell project. In the file's properties I have removed the Custom Tool action and I have set Build Action to Resource (I also tried Conten...

WPF UI not updated upon property change

I'm not sure what I'm doing wrong here... I have a custom HashTable that has a method that allows someone to delete a "partNumber" (a value) from the HashTable. The delete method is as follows: class COSC202HashTable : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; //.... private List<i...

Select folder dialog WPF

Hi, I develop WPF4 application and in my app I need to let user to select a folder where aplication will store something (files, generated reports etc.). My requirements: — Ability to see standard folder tree — Ability to select folder — WPF look & feel, thid dialog must looks like part of modern application designed for Windows Vis...

WPF how users add images

What is the best way to allow a user to insert photos for an image viewer? The end result I am looking for would be thumbnails in a listbox that when selected would open in a viewbox. I understand the binding, but I don't know how to get the photos to a folder or whatever from the user. ...

WPF DataGrid: Automatically re-sort on a DataGridTemplateColumn

In WPF's DataGrid control, if you set a column to one of the default column types (like DataGridTextColumn or DataGridCheckBoxColumn), sort on that column, and then change its value, the grid will automatically be re-sorted. However, if you use a DataGridTemplateColumn (and allow the column to be sorted), it can be sorted, but changing ...

WPF: Get Tabtitle from Content (in template)

Hi Guys, I'm trying to display the Title of an Tabitem in his contentpresenter. Is there a possibility to get this name? For example in the Tabcontrol Template something like <Label> <ContentPresenter ContentSource="SelectedContentHeader" Grid.Row="1" /> </Label> to display the name of the current tab in label. Thanks in advanc...

wpf localization

Which is the best third party tool available for wpf application localization. ...

WPF DataGrid columns alternating coloring

How can I make columns coloring in DataGrid if I also want use AlternatingRowBackground property? I have some ideas, but it doesn't work :(. <de:DataGrid Name="dataGrid1" AlternationCount="2" AlternatingRowBackground="Salmon" > <de...