wpf

Check if an application is idle for a time period and lock it.

In my project I need an application lock (same as windows lock). If the application is idle for a time period the application should be locked i.e, the login window for the application will appear. How can I do it in a WPF C# application? ...

WPF items not visible when grouping is applied

Hi, I'm having this strange issue with my ItemsControl grouping. I have the following setup: <ItemsControl Margin="3" ItemsSource="{Binding Communications.View}" > <ItemsControl.GroupStyle> <GroupStyle> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Sette...

How do I combine brushes in WPF?

I have two brushes. I don't know wath type of brushes they are. They can be ImageBrushes, SolidBrushes or VisualBrushes. I have each in a variable of the "Brush" type. I need to combine two brushes. How do I do it? I tried this. But It didn't work. Here are Back and Front the brushes that need to me combined. Border Bd = new B...

Get keyboard status in WPF Application in Main-Method during startup

When my appliactions starts up in the static void Main Methode I want to determine if a key like Alt or Ctrl is pressed and then start the Application in some kind of Option-Mode. How can I find out if a key is pressed during startup? I found some samples already but they all import a windows dll. Something I don't want to do. ...

Handle exceptions with WPF and MVVM

I am attempting to build an application using WPF and the MVVM pattern. I have my Views being populated from my ViewModel purely through databinding. I want to have a central place to handle all exceptions which occur in my application so I can notify the user and log the error appropriately. I know about Dispatcher.UnhandledExcepti...

WPF Commands - Doing it with no code-behind

I'm building a simple data entry app in WPF form using the MVVM pattern. Each form has a presenter object that exposes all the data etc. I'd like to use WPF Commands for enabling and disabling Edit/Save/Delete buttons and menu options. My problem is that this approach seems to require me to add lots of code to the code-behind. I'm tryin...

WPF application on Citrix

I'm trying to use a WPF application on our Citrix server, and made a really simple window with a button and a textbox. When running the application, noting but the application name on top of the window is shown. Is it not possible to use WPF on Citrix, or is our Citrix server too old? ...

WPF pixel shader with HDR (16-bit) input?

I'm trying to build an image viewer for 16-bit PNG images with WPF. My idea was to load the images with PngBitmapDecoder, then put them into an Image control, and control the brightness/contrast with a pixel shader. However, I noticed that the input to the pixel shader seems to be converted to 8 bit already. Is that a known limitation ...

how to add custom visualization to Media Element (Windows Media Player) in WPF

Hi Team, I just came across this requirement, could find this URL is of close match but the source downloaded is corrupted. http://blogs.msdn.com/adam%5Fnathan/archive/2005/10/24/using-com-interop-to-create-a-wpf-visualization-for-windows-media-player.aspx Also how to add this visualization into Windows Media Player for playing audio f...

WPF Trigger a Command at end of animation.

How can I trigger a Command in my ViewModel at the end of an animation/storyboard using XAML only. ...

Store Image in DataTable

I want to store image into my datatable and while adding colum I want to set its default value, sending you code doing with checkboxes.. public void addCheckBoxesRuntime(){ for (int i = 0; i < InformationOne.Length; i++) { dt = new DataColumn(InformationOne[i][1] + " (" + InformationOne[i][0] + " ...

Problems with printing in WPF Borderless capability not being set in ticket

Ok, I've got a reaaally simple bit of code here which is meant to set the borderless property of the printer to .. well, borderless! So I try and set it, but no matter how much I try, the imagable area is never the whole width of the page, and therefore I cannot size the picture correctly for the paper before printing. I've tried with...

How to build a WPF application with Add-Type C# code

hi, i tryed to build WPF application using Add-Type, but it failed. $a = @' using System.Windows; public class Program { [STAThread()] public static void Main(string[] args) { Application app = new Application(); Window1 w = new Window1(); app.Run(w); } ...

Aligning columns without WPF Grid

I am looking for a good way to design a multi-column layout which reflows the controls in the columns according to the space available. I have a list of labels and fields which display information, and sometimes the view they are contained in needs to be tall and skinny, other times short and wide. A simple solution is to use a WrapPane...

How to add a focus style to an editable ComboBox in WPF

I've been looking at the following example on how to style the combo box, but I haven't been able to create a focus effect when going into a editable combo box. Whenever the combo box receives focus, it should go into edit mode and the component should have a focus style. The basic problem is that whenever I go into the edit mode, it's...

Strange Style Behaviour in wpf?

Ok, I was programming an app that loaded merged dictionaries on runtime to change appearance and behaviour when I got stuck : some of the controls on my forms just weren't reacting to the styles I thought they had to react to. I have tried to simplify the problem as much as I could and came up with something so simple that I'm afraid ...

WPF: Analyse XamlParseException from UserControl in .dll

Hey guys, I have a custom WPF UserControl in a DLL file. I access the UserControl from PowerBuilder via OleObject (COM). I'm trying to create an instance of the UserControl (code in .NET dll). Everything works fine when I'm using it via COM from C++, but in PowerBuilder, I'm getting this error message: Error Message Can you help me to...

Change ListBox item style at run-time

I have a listbox where the items are styled using a ResourceDictionary style which is then attached to the ItemContainerStyle property. This gives my ListBoxItems a BorderThickness of let's say 1. Now I want to collapse the items individually, so I use Visibility.Collapsed but for some reason the border that the ItemContainerStyle has c...

WPF doubleanimation : animate in steps ?

In my current application I have this little animation. It makes a full 360 degrees rotation of a canvas and works fine. <DoubleAnimation Storyboard.TargetName="WaitCanvas" Storyboard.TargetProperty="(Canvas.RenderTransform).(TransformGroup.Children)[0] .(RotateTransform.Angle)" From="0" To="360" Duration="0:0:2" AutoReverse="...

How to create a WPF validation rule to ensure two text fields have the same value?

How would I create a validation rule to ensure Value2 has the same value as Value1? If a validation rule is not the best method then what would be better? I could have the TextChanged event handle this, but I'm wondering if there is something more elegant. <TextBox Name="Value1TextBox"> <TextBox.Text> <BindingPath Path="Valu...