wpf

How to handle ViewModel and Database in C#/WPF/MVVM App

I have a task management program with a "Urgency" field. Valid values are Int16 currently mapped to 1 (High), 2 (Medium), 3 (Low), 4 (None) and 99 (Closed). The urgency field is used to rank tasks as well as alter the look of the items in the list and detail view. When a user is editing or adding a new task they select or view the urge...

Progress Bar restarts

I have a DataGrid and in the Data Template of a DataGridTemplateColumn, i have added a Progress bar. now every time when mouse overs the rows of the data grid. my progress bar restarts its value from 0. I actually changes the Background and border property of the Row from triggers which i have defined in the control template of the Data...

how to extend wpf combo box to bind data?

i need to bind a collection of objects to a combo box which i can use in different forms. so i want create a custom control which binds the collection to the combo box? how t do it by extending combo box? also how can i define the ItemData template? ...

Wpf: Tips for better performance

I am working on a wpf application. In which I am working with a TreeView, each node represents different datatypes, these datatypes are having properties defined and using data template to show their properties. My application reads from xml and create tree accordingly. My problem is that when I load it, it is too slow, I want to know ab...

How to get column value in selectedItems wpf?

I have many records from a database and i display it in a ListView. I need to delete it if I select it (multi-selection). But i need the Id (a column) to delete it and i can't get it. Please help^^ exemple: column: id name note ... 1 name1 note1 2 ... 3 ... if i select 1 and 3 I need to get the value (1 a...

Some doubts in WPF

I am entirely new to WPF . Though I am going through the tutorials and articles from net but I am having doubts . Some of the questions which have striked out so far are What is routed events and what extra thing it does server? What are dependency properties and it's benefits. How dependency properties differ from attached properties...

disable event-bubbling c# wpf

Hi, I'm having the following problem: When I got two labels into each other: <Label x:Name="First" MouseUp="Label_MouseUp"> <Label x:Name="Second" MouseUp="Label_MouseUp_1">This is a label into another label</Label> </Label> And the following code: private void Label_MouseUp(object sender, MouseButtonEventArgs e) { Console.W...

WPF DrawingVisual from my own class

Hi, Im trying to create my own class which contains a DrawingVisual, something like this public class MyObject { public DrawingVisual visual; public bool faceup; public bool flipped; } I have a drag and drop from a listview to a canvas, but when I try to get the object which back from the Canvas i only get the visual, not any of the o...

How to adjust the height of the window dynamically in WPF?

I have a model window that contains expander control. This expander control when expanded shows the user control which allow user to enter input through textboxes. When expander control is collapsed it hides the user control. I want when expander is collapsed or expanded the window will resize its height accordingly at run time. Plea...

WPF MVVM ViewModel constructor designmode

Right, I've got a main wpf window: <Window x:Class="NorthwindInterface.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ViewModels="clr-namespace:NorthwindInterface.ViewModels" Title="MainWindow" Height="350" Width="525"> <Win...

Refresh/Reset View

Hi, I'm using MVP in WPF and I came across a design doubt and I would to get your opinion on this: At some point I need to refresh my view and perform the same initial queries, like when the view was loading. The view's DataContext is my presenter and I have a couple of collections and other variables that are bound to the view. When I ...

Is it possible to have CommandManager requery only specific WPF command instead of all?

I'm trying to implement a highly responsive UI for my MVVM application, so I've chosen to have all command handlers automatically execute in a BackgroundWorker so they don't block the UI. But at the same time, I don't want the user to be able to execute the same command while it is still executing in the background. The solution seems o...

WPF CheckBox to the left of the TreeView

How to insert checkbox to the left of the treeviewitem (expander), so it was the same item. ...

WPF Transforms movement

Ive done some tranforms for my object in the canvas, like rotating and transforming. How can i store the new coordinates afterwards? If I try to move the object around it will only use the new Transforms. ...

Hyperlinks are staying inactive after setting isEnabled=true to parent control

I've got a TabItem contanining a listbox, which has an obeservable collection of my feeds class as its item source. When I refresh/load the feeds into the collection I want to disable the main window so that the user can't go clicking other things while this process is running. So I set tbCtrl.isEnabled=false; to my tab control on the fo...

WPF Enable/Disabled controls from a page placed inside main window application

Hi! I have an WPF application that has a main window. In the left side of this Window there are some buttons into a listbox, it is a kind of menu to access faster to pages. These buttons belongs to pages that they are loaded inside the window when the user selects one. Main window also has another main menu in the top for doing other ta...

Mixing Silverlight-Specific System.Xml.Linq dll with Non-Silverlight System.Xml.Linq dll

I have a Logic layer that references Silverlight's System.Xml.Linq dll and a GUI that is in WPF (hence using the non-Silverlight System.Xml.Linq dll). When I attempt to pass an XElement from GUI project to a method in the Logic project, I am getting (basically) "XElement is not of type XElement" errors. To complicate matter, I am unable ...

WPF Tree doesn't work

Could you tell me why I can't see subItems? I've got winforms apps and I added my wpfusercontrol:ObjectsAndZonesTree ServiceProvider is my webservice. Adn method to get listofcountires with subitems works properly (i get countires, regions from this countires, provinces etc...) ElementHost elementHost = new ElementHost ...

C# WPF XAML Problem with icon in GridViewColumn

I've created a ListView with a GridView component in it. Now trying to fill one of the cells with an icon (PNG) like in the code sample below (save_icon.png): <ListView.View> <GridView> <GridViewColumn Header="Date" Width="Auto" DisplayMemberBinding="{Binding Date}" /> <GridViewColumn Header="Time" Width="Auto" Displ...

How and when to dynamically add columns to a Grid in WPF

Hi we are trying to add ColumnDefinition to a Grid in WPF dynamically from code behind. The question is: when do you do that? In the Usercontrol's Loaded event? We have a ListView that utilizes a DataTemplate which in turn uses the Grid. How do you access that Grid instance (the one inside a DataTemplate) from code behind? It does have ...