wpf

Why does WPF toggle button pulse once unchecked

Within a Desktop app I have a toggle button: <ToggleButton x:Name="CFStglBtn" Checked="cfsCBox_Checked" Unchecked="cfsCBox_Unchecked" IsChecked="True" HorizontalAlignment="Left" Margin="5,0,0,0"> <StackPanel Orientation="Horizontal"> <Image Source="assets\telephone.png" Margin="3,0,0,0" /> ...

Multiple grids in one area

I'm currently creating a WPF application, using C# and XAML in Visual Studios 2010. I have a master grid. In that master grid I have a group bar which you can select different items. Depending on what you select, the middle of the master grid can be totally different. What I was wondering is, what's the best way to program the middle pa...

Integrate Moneybookers into WPF applications

Dear All! I would like to integrate moneybookers payment-gateway into a WPF-application. Accroding to the official gateway manual I need to redirect the user to the moneybookers payment-page and submit some fields posted within an html-form. Has anyone an idea how I could solve this task? Best regards! ...

WPF ComboBox Object Binding - not updating DataContext Object

Hello, I have the following scenario: 1 class called 'Widget' with the properties: ID, Code, Description 1 class called 'MyWidget' with a property: m_Widget As Widget 1 ComboBox The ComboBox has a List(Of Widget) set as the ItemSource. I create an instance of 'MyWidget' named MyWidget1 and I set the property values of the m_Widget to ...

'System.Windows.Data.MultiBinding' is not a valid value for property 'Text'.

I'm trying to write a custom MarkupExtension that allows me to use my own mechanisms for defining a binding, however when I attempt to return a MultiBinding from my MarkupExtension I get the above exception. I have: <TextBlock Text="{my:CustomMarkup ...}" /> CustomMarkup returns a MultiBinding, but apparently Text doesn't like being ...

Setter in property trigger fails if target property already has an explicit value

I'm currently trying to create a ControlTemplate for the Button class in WPF, replacing the usual visual tree with something that makes the button look similar to the little (X) close icon on Google Chrome's tabs. I decided to use a Path object in XAML to achieve the effect. Using a property trigger, the control responds to a change in t...

Programatically WPF Fade In (via extension methods)

I'm trying to write a simple (stand alone) C# extension method to do a Fade-In of a generic WPF UIElement, but the solutions (and code samples) that I found all contain a large number of moving parts (like setting up a story, etc...) For reference here is an example of the type of API method I would like to create. This code will rotat...

Multiple Validation Rules and Validation Templates in WPF

Does anyone have a tactic for dealing with multiple validation rules and templates for those validation rules. Example: I want to have two validation rules (required & data) I want either... One template that can change is display depending on which rule is fired or Two templates, which get displayed depending on which rule is fired ...

Exporting WPF DataGrid to a text file in a nice looking format. Text file must be easy to read.

Hi, Is there a simple way to export a WPF DataGrid to a text file and a .csv file? I've done some searching and can't see that there is a simple DataGrid method to do so. I have got something working (barely) by making use of the ItemsSource of the DataGrid. In my case, this is an array of structs. I do something with StreamWriters ...

The uncatchable exception

Followup: http://stackoverflow.com/questions/3057822/the-uncatchable-exception-pt-2 I'm writing a custom binding engine; my converter is being called before DataContext is set on the target element. This in and of itself isn't a big deal because it will get updated when DataContext eventually receives a value. What is causing problems i...

How to suppress Cut, Copy and Paste Operations in TextBox in WPF?

I want to suppress Cut, Copy and Paste operations in Text Box. I don't want user to do any of these operations through keyboard or from default context menu in the text box . Please let me know how can I restrict these operations? ...

Databinding to Classmember of Classmember

Hello, I need some help about WPF and Databinding. Let's say I have a ClassA with a member of ClassB. ClassB has again a member, maybe an int: ClassB { public int MemberOfB { get; set; } } ClassA { private ClassB _theB; public ClassB MemberOfA { get {return _theB;} set { _theB = value...

Grid MouseOver with data condition

I have a listbox with a ItemTemplate which defines a Grid. The grid has a style which sets the background and foreground based on data bindings. <Style x:Key="GridStyle1" TargetType="{x:Type Grid}"> <Style.Triggers> <DataTrigger Binding="{Binding StoryType}" Value="Release"> <Setter Property="Bac...

How to track which character is deleted in TextBox in WPF?

I want to track which character is deleted by the user through Delete or BackSpace Key. I am handling TextBox_ChangedEvent of textbox. Can I extract the deleted character from TextChangedEventArgs *e.Changes* and if yes How can I do that? I want to restrict user to from deleting any characters from the TextBox. I want user can delete ...

How to bind to a collection within a collection in WPF

Hi, I'm still at the early stages of learning WPF and have decided to try and write a fairly simple Contact Browser app to get to grips with the fundamentals. To add to the complexity I am using Objects from another application. So far I have been able to successfully bind a ListBox control to a Collection and display the Contact Name...

.NET 4.0 & CrystalReports

I have a dll build with target framework 3.5 that manage reports; this dll use the version 10.5.3700.0 of CrystalDecisions.CrystalReports.Engine Now, I have created a new wpf application based on .NET framework 4.0 and I added the report dll reference to project. I had to install the Crystal Reports for Visual Studio 2010 library (http...

Problem with validation and multibinding

Hi, In my WPF application I use the following xaml: ... <TextBox services:TextBoxService.IsFocused="{Binding Path=IsSelected, Mode=OneWay}" FocusVisualStyle="{x:Null}"> <MultiBinding Converter="{StaticResource mconv_operableToString}" UpdateSourceTrigger="PropertyChanged"> <Binding Path...

Office ribbon for WPF 4.0

Hi all, It is rumoured that WPF 4.0 would deliver us an out-of-the-box Office Ribbon. A new WPF Ribbon Control will be available for download shortly after the release of WPF 4. [1] Now my internet and MSDN search turned out to be fruitless, and as far as I know, it would be release after the .NET 4.0 framework would launch. ...

WPF ColorAnimation seems to retain part of original colour?

Hi guys, I'm having a strange problem with a colour animation. I have a list of items bound to a listbox. These items have an enum property which can have one of three values - NoRemarks, RemarksFound and RemarksUpdated. On the datatemplate for this listbox, I have a rectangle which displays a colour related to the item status - Red,...

Win32 ShowWindow API and WPF

I am writing a desktop application that requires only one instance running, means if there is already running application instance, when another application instance runs, it check and shows actives the running application and exit itself quietly. I can get the running window's hwnd handle, but when I use ShowWindow API to show that wind...