wpf

Window application timeline problem: Using WPF in c# based application

I am making window application using WPF. For that i have used Expression blend. I am facing one problem while animating button steps are mentioned below: Place one lable-1 over form then Place one button-1 inside lable then Design samll button like start stop pause and place them inside button-1 Apply timeline animation for button-1 o...

Mysterious Resources /CultureInfo behaviour in WPF App

i have two Resources files in the Properties folder of a WPF-project (VS 2008): Resources.resx Resources.de-DE.resx Selecting the culture "de-DE" does not work (no error, but always the strings from "Resources.resx" are used): public App() { UntitledProject2.Properties.Resources.Culture = new CultureInfo("de-DE"); } ...

WPF MVVM Cancel Edit

How can I implement cancelation of editing an object using MVVM. For example: I have a list of customers. I choose one customer an click the button "Edit", a dialog window(DataContext is binded to CustomerViewModel) opens and I start editing customer's fields. And then I decide to cancel editing, but the fields of the customer have been...

WPF ComboBox How to bind the selected item in code ?

I have a combo box which is populated on selection's from two other combo'. No problem I have this working. Problem is I only want to activate the Selected Item binding after this has happened. Here is my combo <cuc:ComboBox Name="GopLenTypeCombo" Width="240" Height="24" IsSynchronizedWithCurrentItem="True" ...

Can't add a routed command to a CheckBox in WPF

Hi, A custom RoutedCommand is used by some menuItems; I would like to use the same RoutedCommand with checkboxes : <CheckBox Command="local:MainWindow.SwitchContextCommand"> The compiler gives no error, but when i lauch the app, I get an exception telling me that the Command value can't be null and consequently SwitchContextCommand c...

How to make add a fade-in/fade-out animation based on ViewModel property value?

I have a ViewModel which exposes the string property PageToolBarVisible which can be true or false: private string _pageToolBarVisible; public string PageToolBarVisible { get { return _pageToolBarVisible; } set { _pageToolBarVisible = value; OnPropertyChanged("PageToolBarVisible"); } } ...

How to make a XAML animation make the element disappear AFTER it has faded out

Thanks to the answer on this stackoverflow question I was able to get the following animation to work, so that when the value of my ViewModel property PageToolBarVisible causes the toolbar to fade in and out. The problem is: the toolbar opacity fades out, but it the space it took up is still present after it fades out the initial tool...

How can I make a XAML Trigger call a XAML Style?

This style correctly fades my toolbar in or out based on the changing of a ViewModel Property: <Style x:Key="PageToolBarStyle" TargetType="Border"> <Style.Triggers> <DataTrigger Binding="{Binding PageToolBarVisible}" Value="true"> <DataTrigger.EnterActions> <BeginStoryboard> <...

WPF : CollectionViewSource displaying grouped by Property

In Xaml, suppose I have a CollectionViewSource who's source is set to observable collection of objects of type Order: public class Order { public int ContractID { get; set; } public double? Price { get; set; } public OrderSide Side { get; set; } } public...

MVVM WPF Application Developer skill set

Hi, What kind of skills should a WPF developer know to create MVVM applications? Things like Attached Dependency Properties and DelegateCommands. Thanks! ...

Raise MouseButton.Middle in "Click" evenf for a button

I have a button, and when I click on it, I need it to peform as if I have just clicked the scroll wheel on my mouse. Is this possible? <Button x:Name="centreButton" Click="performScrollButtonClick"/> ...

How to get View element to fade in/out based on value of ViewModel property?

The View and ViewModel listed below show two buttons: when you click Show ToolBar, the toolbar fades in when you click Hide ToolBar, the toolbar fades out However, the following things don't work: when the application is loaded and OnPropertyChanged("PageToolBarVisible") is fired, if the value is false then the Toolbar shows in spi...

In WPF, how do I get the Data Object associated to the Tree View Item underneath the mouse cursor?

In my WPF application, I have a treeview. This treeview is bound to a custom class (i.e. not TreeviewItems). So I use a hierarchicalDataTemplate to control how the tree renders. When my mouse is over a tree view item, I would like to get the Data Object (i.e. my custom class instance) associated with the tree view item. How do I do this...

WPF. Warn about CapsLock

I have a DataGridTemplateColumn with DataTemplate as a PasswordBox. I want to warn user if CapsLock is toggled. private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) { if (Keyboard.GetKeyStates(Key.CapsLock) == KeyStates.Toggled) { ... Now, I need to raise some PopUp here. I don't k...

WPF Validation in an ElementHost control

I've got a WinForms form that contains an ElementHost control (which contains a WPF UserControl) and a Save button. In the WPF UserControl I've got a text box with some validation on it. Something like this... <TextBox Name="txtSomething" ToolTip="{Binding ElementName=txtSomething, Path=(Validation.Errors).[0].ErrorContent}"> <Bind...

How do I get rid of "[some event] never used" compiler warnings in VS2008?

For example, I get this compiler warning, "The event 'Company.SomeControl.SearchClick' is never used." But I know that it's used because commenting it out throws me like 20 new warnings of XAML pages that are trying to use this event! What gives? Is there a trick to get rid of this warning? ...

Is this a good case for use of RoutedCommand?

I have a WPF page that has 2 ContentControls on it. Both of the ContentControls have an image, one being much smaller than the other. When mouse over the larger image I want to show a zoomed in view on the smaller image. Something very similar to this: http://www.trekbikes.com/us/en/bikes/urban/soho/soho/. I think I want the larger...

Updating list with partial results of the search run in another thread

I have a WPF form with ListView (resultsList) and I have a static method Fetcher, which returns results of the search for some information over the webpage with pagination (all pages at once, or one return for each page). It is done using WebClient so fetching 40 sites takes about 2 minutes. I don't want to appear the results immediately...

Add a user control to a wpf window

I have a user control that I've created, however when I go to add it to the XAML in the window, intellisense doesn't pick it up, and I cant figure out how to add it to the window. I'm pulling my hair out here! Any help is greatly appreciated! ...

Reorder tabs in WPF TabControl

Is there an easy way to customize the WPF TabControl so that it supports TabItem drag and drop - similar to what IE and firefox do. ...