wpf

Can I throw a property changed event for items in a collection bound to my Listbox.ItemSource?

I have a user control that inherits from the ListBox class and displays a list of a custom class I have named DataSeries. Each DataSeries has several dependency properties, like LineColor for example. I can bind my DataSeries collection to the listbox itemsource with no problems, and it displays with the template I have defined (the te...

WPF ContextMenu Style structure

Hello, I would like to restyle a context menu, but I have a question about how to structure my Xaml. In my application resources, I have something like this: <ControlTemplate TargetType="MenuItem" x:Key="MenuItemTemplate"> ... </ControlTemplate> <ControlTemplate TargetType="ContextMenu" x:Key="ContextMenuTemplate"> <ControlTe...

WPF: Are 'automatic' animations possible?

I have an ItemsControl that shows items using DataTemplates. When certain properties of the items change, I would like the changes to appear animated in the ItemsControl. For instance, an item has a Thickness and a Color and when these properties change, I would like to show an animation transitioning from one to the other. What is the e...

WPF - IsEnabled Binding to DependencyProperty not working properly

I have a dependency property defined in my window as below: public static readonly DependencyProperty IsGenericUserProperty = DependencyProperty.Register("IsGenericUser", typeof (bool), typeof (MainWindow)); public bool IsGenericUser { get { return (bool) GetValue(IsGenericUserProperty); } set { SetValue(IsGenericUserProperty, v...

WPF databinding binding error notification

OK, working on WPF(using MVVM) and came across a question, want some input. I have a simple class like below(assume I have IDataErrorInfo implemented): public class SimpleClassViewModel { DataModel Model {get;set;} public int Fee {get { return Model.Fee;} set { Model.Fee = value;}} } I then try to bind to it in xaml: <TextBox Te...

WPF - No IsEnabled=true behavior using style with animations

I have asked a question here but then I realized my problem was not the code but the style I am using for a button. Since the problem is completely different than the one initially asked, I thought it would be more beneficial for other users if I just asked the "right" question again. Here I go: I am using the template below in my butto...

wpf toolkit data grid

hello i'm building a wpf app with data grids, the pattern is model view view model. all og my screens contains a contentcontrol, and i just assign him the view model, that have a suitable data template, anyway, my problem is with combo box column, the data context is the presented entity, and i need it to be the view model. whats the ...

WPF DataTemplate: How to create a tooltip just-in-time?

I am using DataTemplates to render items in an ItemsControl. I want to show a tooltip for each item. If I use a binding such as ToolTip="{Binding MyToolTip,Mode=OneWay}", WPF gets the tooltip once at the beginning and does not update the tooltip when it is opened. My items implement INotifyPropertyChanged, so in principle I could genera...

Problems binding Foreground property of GroupBox HeaderTemplate.

I defined a DataTemplate for the header of my GroupBoxes: <Style x:Key="GroupBoxHeaderStyle" TargetType="{x:Type GroupBox}"> <Setter Property="Foreground" Value="White"></Setter> <Setter Property="HeaderTemplate"> <Setter.Value> <DataTemplate> <Tex...

Login Wpf ...is it right?

Hi, i have a WPF Application with a LoginWindow to access,so i create a Splash Screen for this Login window as follow : - in App.xaml < Application x:Class="WPF.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="Application_Startup" /> ...

WPF DataGrid sort by ComboBox field

I have WPF datagrid with combox column (ID is real value, Desc is displayed value) and when I click on header of that column automatically sorts by real value (ID). I want to sort by displayed value. My WPF datagrid has 4 columns: IdPerson, DescSchool, IdSchool and School. Column "School" is comboBox with this values:ItemSource = schoo...

C# User Control that can contain other Controls (when using it)

I found something about this issue for ASP, but it didn't help me much ... What I'd like to do is the following: I want to create a user control that has a collection as property and buttons to navigate through this collection. I want to be able to bind this user control to a collection and display different controls on it (containing ...

Is it possible to add more than one effect to a Label in Blend?

I'd like to have a label with a blur effect and a drop shadow effect. ...

Double Click vs Single Click - are these mutually exclusive

Can anyone name an instance of an application where clicking an entity (say image) does one thing, but if you double-click it it does something different? The only example I've been able to find is in double-clicking a track in iTunes but then that selects it (single click function) and then plays it (double-click function) which implie...

WPF: Button single click + double click problem

Hi All, I have to handle both the single click and the double click of a button in a WPF application with different reaction. Unfortunately, on a doubleclick, WPF fires two click event and a double click event, so it's hard to handle this situation. It tried to solve it using a timer but without success...I hope you can help me. Lets...

WPF Image External Resource

I have a custom control library with a resouce dictionary that references an image in the same custom control library. I then have a WPF application with a refernce to the custom control library which contains a resouce dictionary with a style the utilizes the image. When I try to use the style from the external resouce I get an error ...

Error loading XAML Markup at runtime when hosted in strong named assembly

I have a mixed Winform/WPF application which frequently throws the exception: Could not load file or assembly <Full Assembly Name> or one of it's dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT 0x80131040) Error at object <Object Name> in markup file <file>.xaml T...

Why can't I modify an object after animating it?

After executing this code... DoubleAnimation a = new DoubleAnimation(newWidth, new Duration(...)); ThicknessAnimation b = new ThicknessAnimation(new Thickness(...), new Duration(...)); border.BeginAnimation(Border.MarginProperty, b); border.BeginAnimation(Border.WidthProperty, a); ...this code no longer works (Margin does not change a...

Find the center of a line in WPF

Hi, I'm working on an application, that the user clicks 2 points on a control, and a line is drawn connecting those 2 points. The problem is that I need to draw another line that starts on X.Y (returned by a function) intersects the line generated by the user right in the center of it. How can I do this? I'm using DrawingVisual and Dra...

TreeView in GridView

Hi, I know there must be a way to do this, and perhaps someone has already done it. I googled like crazy but found nothing at all. Anyway, what I want to do is have a TreeView in the first column of a GridView using WPF, which can expand and collapse and that will show/hide the row it belongs to, pretty much something like this (the demo...