wpf

Radio Button Error Style

I have implemented an error style for textboxes using the following code. This sets a tool tip and puts a nice error image to the right of the textbox if the element reports an error status via an IDataErrorInfo interface: <!-- Set error style for textboxes --> <Style x:Key="txtBoxErrStyle" TargetType="{x:Type TextBox}"> ...

ScrollViewer not scrolling....

The scrollviewer below does not work. I tried everything I could find on this site and beyond: embedding the scrollviewer in an Grid, embedding the ScrollViewer's children in a grid, embedding the Scrollviewer in a StackPanel with fixed height, setting/binding the height of the scrollviewer, all to no avail... Who shows me the way back t...

How to make Windows.Media.Imaging.GifBitmapDecoder decode WHOLE frames?

I'm a novice in WPF and .NET programming, but I think I'm getting this right: Windows.Media.Imaging.GifBitmapDecoder has no capability to decode "partial" frames from Gif file. For example, I have a tiny GIF file of 2 frames: 1st frame is like a keyframe and 2nd frame includes only pixels that must be changed in 1st frame to get the need...

C# wpf question custom checkbox

Hi, I just started getting deeper into C# and WPF design, so dont mind if I ask for some basics. I am trying to port one of our internet applications to a c# application and having some difficulties. I need 4 checkboxes which look like this. If you click them they should look like the second one. I was able to do it with images whi...

How can I add a PropertyChangedCallback to a dependency-property of the base class?

I have a class derived from System.Windows.Controls.UserControl, and I need to add a PropertyChangedCallback to the FrameworkElement.Margin dependency-property. How is this accomplished from my C# code? I can't find any good examples of this in MSDN. ...

What is the proper MVVM way to place a collection of symbols on a map?

I have a WPF Window with a Canvas that is used to show a terrain map. I would like to place symbols on this map according to an IEnumerable<MapSymbolDefinition> where MapSymbolDefinition is defined as follows: public class MapSymbolDefinition { string SymbolFileName { get; set; } int XLocation { get; set; } int YLocation { get; se...

Can MVVM gives any advantage if databinding is not used between view and viewmodel?

In MVVM, The ViewModel is a model for the view. And the real power comes in when we bind ViewModel to View in WPF. However, if third party control does not support data-binding (not supporting all functionality), in that case is it worthwhile to use MVVM? ...

WPF Standard Commands - Where's Exit?

I'm creating a standard menu in my WPF application. I know that I can create custom commands, but I know there are also a bunch of standard commands to bind to. For example, to open a file I should bind to ApplicationCommands.Open, to close a file I should bind to ApplicationCommands.Close. There's also a large number of EditCommands, ...

MVVM pattern and semi-global data

I have developed some MVVM based WPF code and am in need of some minor refactoring but prior to doing that I need to decide the best architecture. I originally started with an application that could present several similar (but separate) representations of my data. Let's call it RecordsViewModel which had a corresponding RecordsView. ...

Windows 7: Saving as TIFF CCITT Group4 changed?

My program, that converts a multi page TIFF to PDF is not longer working under Windows 7. The program contains code that walks through the pages of the TIFF, converts each page as TIFF with CCITT Group4 compression and inserts the bitmap data in the resulting PDF file. Converting is done in the following way (c#): ImageCodecInfo tif...

Take screenshot of wpf popup window

I try to take a screenshot of an application writen in WPF and the application is not captured, must I use a special tool to take the screenshot? ...

Can we have object from a already running application using reflection?

Hi, I have a simple WPF application which is already running. Can i access its objects like properties using reflection? So that i can use these object to do some operations like click on button or entering text in text box in the already running application. Thanks in advance. Akash Kansal. ...

Have a wpf window inside another wpf window

Is there a way to host a WPF window inside another WPF window. I have a couple of somewhat complex forms in place. But now to simplify things I am trying to merge a few of them as tabpages inside one 'Dashboard' form. Please note that I am not trying to host a Windows Form, but another WPF window ...

How to draw a Bezier curve programmatically in WPF?

Hi there, I need to write a simple WPF program to draw a Bezier curve, but I have to draw it programmatically since I need to allow user to modify the shape interactively. Any code sample to do this task is highly appreciated! Thanks, Mike ...

C#/WPF: Idea how to display the last row of a ListView seperately?

Hello, I've a ListView with about 10 GridViewColumn's and about 100 Lines/Row. I'd like to display a "Total" or summary row at the bottom of the ListView. Does anyone have a idea how to do that, with keeping the ColumnWidth etc. like the others and making it a seperate item, so the "main" ListView can have a scrollbar? I've uploaded h...

What's the difference between ContentControl and ContentPresenter?

I'm not sure when I should use ContentPresenter instead of ContentControl (and vice-versa). At the moment, I'm using ContentControl pretty much all the time in my DataTemplates. When would ContentPresenter be a better choice? and why? I've read http://www.beacosta.com/blog/?m=200611 but I still don't get when/why I would choose one over...

Why does an empty WPF Application consume 50MB?

I'm on Vista 64 and a blank 'WPF Application' template allocates 50MB when I press compile and run. Surly this is way too much for an empty white box?! Is there anything I can do to make my WPF applications less thirsty? Jan ...

Trigger seems not to fire, what am i doing wrong?

I have enter actions defined for two triggers as such: <Trigger Property="ToggleButton.IsMouseOver" Value="true"> <Trigger.EnterActions> <BeginStoryboard x:Name="GlowStart_BeginStoryboard" Storyboard="{StaticResource GlowShow}"/> </Trigger.EnterActions> </Trigger> <MultiTrigger>...

How to use the WPF progressbar ?

Hello I am trying to use the WPF progressbar control with the IsIndeterminate property set to true. The problem I have, is that it doesn't get updated. I am doing something like this: pbProgressBar.Visibility = Visibility.Visible; //do time consuming stuff pbProgressBar.Visibility = Visibility.Hidden; I tried to wrap this in a thre...

WPF -- Automatic CRUD Builder?

Are there any wpf crud builders ou there yet? Thanks! ...