wpf

Zoom control to WPF Form

How can I implement a zoom control to my wpf forms similar to the one avaialble in the visual studio designer? thanks! ...

How to make the WPF DatePicker control look like its WinForms cousin?

I downloaded and installed the WPF Toolkit (which provides controls that could not be shipped in time with VS2008). However, the DatePicker control does not look like its WinForms cousin. First, the dropdown button is not a dropdown, but a small picture of the calendar. Secondly, the calendar opens to the right on the control rathe...

Combining two observeable collection to a listbox?

Hi, I have two observeable collection both set to a class of properties. I am needing to combine both of those collections into one listbox. I have looked up at the Compositecollection class but it is not what I need. Ideally, I want the listbox to look like this... Think of this as a listbox control and each listbox item contains obj...

How to limit cursor movement in WPF based app?

I'm working with a WPF app, more specifically a Canvas with draggable elements. Once an item is being dragged, I'd like to limit the scope of cursor movement to inside the canvas where the items are being dragged about. The event which can start a drag is shown below private void WidgetCanvas_PreviewHeaderLeftMouseDown(object sender,...

WPF Grid - How to apply a style for just one column?

I have a WPF Grid with many rows and columns, all containing things like TextBlocks and TextBoxes. For this specific situation I want all the stuff in column 1 to have padding, and all the stuff in column 2 to be aligned right. It seems to be very non-WPF to have to set those properties on each item in the grid. I know I can create a s...

WPF's ICollectionView.filter with large sets of data

Hello, I'm working on an wpf app which contains a listview with quite a lot of data (10 000 to 100 000) rows. The user can apply all sorts of filters to this listview making the filter logic quite advanced (and slow). For now, the relevant part of my code looks like this: ICollectionView view = CollectionViewSource.GetDefaultView(hugeL...

Why is INotifyPropertyChanged not updating the variables in XAML?

I want to simulate data changing in the model and having that data be reflected in XAML. As I understand I need to implement INotifyPropertyChanged. However, in the following code example, XAML displays the data from the customer only once but the date and time never changes. What do I have to change in the following example to make X...

INotifyPropertyChanged on a property that contains an i list

Hi i am using this code in myClass to change content in my wpf applciation public event PropertyChangedEventHandler PropertyChanged; protected void Notify(string propertyName) { if (this.PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } Everytime i chan...

With WPF, scrolling down a ListView is fast, scrolling up is slow

I have a weird issue with my ListView. This ListView is linked to a DataSource containing a thousands items so it's pretty big. My issue is that scrolling up is very slow... whereas scrolling down is ok. Any idea why? ...

WPF Listbox display next element after SelectedItem

Hello, I have TextBox and ListBox with bunch of elements. TextBox has KeyDown event handler, the idea behind this is to allow user to press up and down keys to scroll inside ListBox while focus is on TextBox. When user presses "down key" several times, selected element becomes last visible element on screen. If user has reached bottom...

Some advice how print in WPF with good result.

Hi all, next month I will begin to develop a project and I'm studying about that (I'm a novice). In this project I will create many report storing data from a Database so I'm concentrating about how print the report using WPF. I need to use many features as follows: page header, page Footer, multi page, page number and so on. I ask yo...

What is the shorcut in visual studio to switch from code behind to Xaml Code ?

I'm used to press shift+F7 to switch between my code behind and the designer (which takes between 1 and 5 seconds to load) then I always have to click on View Xaml to modify my XAML code. I don't find any shortcut in Tools/Options/Keyboard to go directly (from code behind to XAML code). How can I do that ? ...

Fat Models, skinny ViewModels and dumb Views, the best MVVM approach?

Through generous help on this question, I put together the following MVVM structure which displays the changes of a model in real time in XAML (current date/time), very nice. A cool advantage of this set up is that when you look at your view in design mode of Visual Studio or Blend, you see the time ticking by, which means th...

Undo journaling: focusing the control being undone

I'm writing an undo journal for my WPF data-entry screen, which will track changes across all the controls. When the user selects Undo, I want to not only revert the latest change, but put focus back in the control whose value is being reverted. I'm struggling with the best way to put that focus back. My ViewModel will be the part that ...

Invalidate CollectionViewSource

Hi all, I've defined the following view: <CollectionViewSource x:Key="PatientsView" Source="{Binding Source={x:Static Application.Current}, Path=Patients}"/> Where Patient is the following property: public IEnumerable<Patient> Patients { get { return from patient in Database.Patients orderby patient.Lastname select p...

GroupStyle sum not updated when multiple items

Hi everyone, First question here. I hope I won't mess it. Also excuse my English. I have successfully applied the trick explained here. But I still have one problem. Quick recap : I display users in a ListView. Users are regrouped by Country, and in the GroupStyle DataTemplate I display the sum of all group related Users.Total, using ...

Is it ever too late to implement an architectural pattern such as MVC or MVVM?

I've been unleashed on version 2 of an application my company has been working on. It was our first foray into WPF and needless to say, a lot of lessons were learned. The product took a year to develop, so it's not a small application by any means. Everyone recently came on board with MVVM. Now that we have a large code base with ple...

DataBind to a textbox in WPF

Hi, I'm completely new to databinding in WPF, and I'm trying to bind an object property to a textbox. My object is public class TestObj { private m_Limit; public string Limit { get { return m_Limit; } set { m_Limit = value; } } My XAML looks like <Win...

WPF: How to install thumb behavior in a Canvas?

I would like to have a Canvas that supports the DragDelta event. My first idea of how to do this was to make a ControlTemplate that includes a thumb. But I do not know how to do this correctly. How can I change the XAML below to make it compile, and what's the right way to install the DragDelta event handler? <UserControl.Resources> ...

WPF: Trigger animations on elements by name from EventTrigger on a dynamically created control

I have a Grid inside of an ItemsControl's DataTemplate, so there will be many copies of this grid. I want a mouse click on the grid to trigger the storyboard of an element outside of the DataTemplate. For example, I would like to animate Transform properties of a named element that exists elsewhere in the Window. Let's say my DataTemp...