wpf

how can i get data from view

i use MVVM to built my project, now i have some troubles,when i click a button, i want get data from view to viewmodel, what should i do? thanks Bob ...

Can I have my Window exe (with a GUI) expose a COM interface.

I have a C# based windows exe using a WPF GUI. My GUI app. polls another window service every minute running on same machine for some updates. Can i expose a COM interface into my WPF GUI exe so that i can remove polling and instead window service make a COM call into the WPF GUI exe app to provide updates? ...

How to Bind Flags Enums To ListBox In MVVM

Hi, I want to bind an enum which has flags attribute to a listbox with a check list box item template in mvvm pattern? How can I do this? [Flags] public enum SportTypes { None = 0, Baseball = 1, Basketball = 2, Football = 4, Handball = 8, Soccer = 16, Volleyball = 32 } <ListBox Name="checkboxList2" ...

Should a derived class handle the events of a base class? (C# / WPF)

I am creating a class that derives from the WPF RichTextBox control and I need to execute some code in the copy and paste events. I understand that, whenever possible, it is best practice to implement event-based code in a derived class by overriding the base class method that raises the event. However, no such method exists in this cas...

WPF Animate non-fixed width

Hi Guys, I've been working with WPF for some time. I'm searching for a way to animate a non-fixed width of elements with double animation, it seems that i can't give From="0" To="*" or From="0" To="Auto" for Storyboard.TargetProperty="Height". I assume i have to work with precenteges, something like: <DoubleAnimation ... ... ... Fro...

WPF richtextbox selection issue

i ve two richtextbox one below the other. when i mouse select in one rich textbox.the other richtextbox mouse selection should not be deselected.Is there any way to do this. ...

OpenSource VirtualizingWrapPanel fails when removing Item

I use the VirtualizingWrapPanel from here: http://virtualwrappanel.codeplex.com/ The issue I experience is already spotted in the issue-tracker...: http://virtualwrappanel.codeplex.com/workitem/1 I don't really get the virtualization-code (otherwise I would have written it on my own ;) Why does it crash when removing an Item? ...

WPF/XAML: How to change a borders background with a colorpicker

Hello everybody, i have a xaml resource file with some definitions of datatemplates. In one datatemplate i have a border background bound to a property of its dataobject. I also have a colorpicker user control which is part of the contextmenu of the border. Now i'm trying to bind the dependency property "CustomColor" of the colorpicke...

Silverlight repeat behavior in visual state.

I have visual state = loading. And i need in this visual state show loading circle with always repeated animation. But it repeats only once! How can i set repeat behavior to forever?? <VisualState x:Name="LoadingChildNodes"> <Storyboard RepeatBehavior="Forever" AutoReverse="False"> ...

Copy WPF Web Application

I have a WPF XBAP application, that i run using visual studio. Everything works fine. Now i want to send it to another person, this person has a laptop and i want him to run it directly from his laptop. I sent him the content of the bin/debug folder, when he opens the xbap file, he gets a message "downloading..." and then an error, somet...

How to update windows on localization switch?

When I switch the language (localization) it only affects newly created windows. How to update localized texts for currently opened windows? I mean, smart way, so let's say if I have textbox and button, and I already entered some data the localization switch should not affect it: [ 5 _ ] cancel --> switch to polish (for example) [ 5 ...

ItemTemplate: ListBox vs ItemsControl

Hi, I'm quite new to the WPF world and I'm having some problems with templating items in an ItemsControl. What I need is to template elements (mostly buttons) inside an ItemsControl (or the like). If I'm using the following XAML code ... <ItemsControl> <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type Button}"> ...

Optimizing the infragistics wpf datagrid

I should start out with the disclaimer that I don't have a lot of info into this problem, but I wanted to put a feeler out to see if anyone else had this problem. I started a new job and some folks here are using Infragistics WPF datagrid. The grid was selected because of the visual flexibility, but apparently when there are large amount...

.NET4 WPF Datagrid - Responding to different datatypes

I'm a novice programmer and I've been doing it more as a hobby then a career. As such I'm putting together an application for generating invoices for company I work for. I have the invoicing stuff working which takes in data feeds from our suppliers and matches up customers, products and rates etc. and produces the invoices. I'm now tryi...

Data Binding in WPF control doesn't pick the new data from IPropertyChangedNotify call.

Project Overview Basically I was creating WPF application using MVVM pattern. However I had a thread which was updating my Data Model, so ViewModel, had to be notified about these changed and I needed a Notification mechanism in my Model. That would make my app make propagating notifications from one class to another, so I decided to Ha...

Window.Template kills any Validation.ErrorTemplate ?

Hallo Stackoverflow fellas! In my recent wpf application building I ancountered a strange behaviour: When I set the Template of the Window class in my application every Validation.ErrorTemplate doesn't appear anymore. So in my App.xaml I have defined the following: <Application.Resources> <Style TargetType="{x:Type TextBox}"> ...

DataContractSerializer problem with events/delegate fields

On my WPF application, I am using DataContractSerializer to serialize object. I observed that it fails to serialize the types that has got an event or delegate declaration. Consider the following failing code: [Serializable] public abstract class BaseClass { public string Name { get; set; } public event PropertyChangedEventHand...

How does one "disable" a button in WPF using the MVVM pattern?

I'm trying to get a grasp on WPF and MVVM and have been making good progress. The WPF and MVVM side of things are going well. However, the XAML and data binding side is a whole other story :) How would I go about "disabling" a button? For example, I have a CanClose property in my view model that determines whether or not the applicati...

WPF: Command parameter for a delete command in a list

In my viewmodel, I have a list (ObservableCollection) containing items. In the view, this list is displayed in an ItemsControl. In each row, there is a "Delete" button. I want the command behind the button to remove the item from the list. <ItemsControl ItemsSource="{Binding myList}"> <ItemsControl.ItemTemplate> ... ...

Launch a desktop application and Issue commands from a custom hyperlink,..difficult?

Okay,.. I'm looking into technologies for a 'Case Management' solution design at the moment and one of the requirements is to be able to receive an email from the system and have the user be able to jump straight to that case,..by id or something similar. Many of the requirements fit well with a smart client architecture so I'm consider...