wpf

Window out of the screen when maximized using WPF shell integration library

I'm using the WPF Shell Integration Library to create a custom chrome of my wpf app. All is good, but when maximizing the app, 6 or 7 pixels are out of the screen. This is the code I'm using: <Style TargetType="{x:Type local:MainWindow}"> <Setter Property="shell:WindowChrome.WindowChrome"> <Setter.Value> ...

TabItem Binding WPF

Hi, I'm just learning WPF and I could use some help. I have an application which use TabControl and dynamically generates new tabs,on each Tab I have one TextBox and now I'd like to add an undo button to the tool bar which is not the part of the tab (VisualStudio like). The undo button has to work only on the TextBox wich is on the activ...

Image Resize Aliasing in WPF v4 but not under v3.5

I am using WPF for an image resizing pipeline which has been working beautifully under .NET v3.5. I just upgraded the project to target v4.0 and now all of my resized images are heavily aliased. None of the image pipeline code has changed. Has a default WPF setting changed between v3.5 and v4.0? How do I control the dithering of my res...

ThicknessAnimationUsingKeyFrames doesn't work the first time, but second and all subsequent times work just fine

I have the following Storyboard: 'LayoutMargin' is a dependency property defined in the ancestor Window. This is the problem I'm having: The first time I run the animation it doesn't work - as if the LayoutMargin.Value isn't set. However, the second time I run the animation,...

Make a c# / wpf event fire only once?

I have a case where I want a given event to execute once, and only once. I'm trying to do it this way, but I'm having prolems (else I wouldn't be asking). Note that the following code is inside the function that decides that the event needs to be fired. EventHandler h = delegate(Object sender, EventArgs e) { FiringControl.TheEvent...

Where has XamlPad gone in .NET 4.0 / Windows SDK v7.1 / Visual Studio 2010?

I can't find XamlPad anywhere after I installed .NET 4.0 / Visual Studio 2010 and Windows 7 SDK - v7.1. I tried searching C:\Program Files\Microsoft SDKs\Windows\v7.1\bin and did a dir /s xamlpad.exe to see if the Windows Index service didn't get to that folder yet. And it's not under Start Menu -> All Programs -> Windows SDK v7.1 --> ...

AvalonDock document binding

Hi, I'm using AvalonDock (link) to create my application. I have a toolbar and a documentpane (VisualStudio like) and each new document contains a textbox. And now I'd like to add an Undo button to my toolbar which will undo changes on the textbox wich is placed on the selected document.It's completely same like it's in Visual Studio. ...

Question about making Asynchronous call in C# (WPF) to COM object

Hi, Sorry to ask such a basic question but I seem to have a brain freeze on this one! I'm calling a COM (ATL) object from my WPF project. The COM method might take a long time to complete. I thought I'd try and call it asychronously. I have a few demo lines that show the problem. private void checkBox1_Checked(object sender, Routed...

How to render a bitmap from a WPF element that has a bitmap effect?

I'm able to render a Visual to a bitmap fine with this code: Rect bounds = VisualTreeHelper.GetDescendantBounds(target); RenderTargetBitmap renderBitmap = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32); DrawingVisual visual = new DrawingVisual(); using (DrawingContext context = visua...

Making a rectangular selection in a RichTextBox with Alt-Left-Mouse sweep?

There are quite a few applications that allow you to select a box or rectangle of text by sweeping with mouse while the Alt key is pressed. Visual Studio 2010 does this in the code editor, for instance. Emacs does it. Winword does it. We've all seen it. It seems like there must be a standard pattern to follow to encode this behavior but ...

How to make WPF app work as a child process in Citrix

I am working on a 3rd party application that allows plugins to be written in .NET 1.1. I have decided I would like to write my plugin to call a seperate process from the .NET 1.1 plugin (achieved using Process.Start). This is fine- I create a new process that is a WPF app. When I launch this through MSTSC everything works as expected, h...

WPF binding to ComboBox SelectedItem when reference not in ItemsSource.

I'm binding the PageMediaSize collection of a PrintQueue to the ItemSource of a ComboBox (This works fine). Then I'm binding the SelectedItem of the ComboBox to the DefaultPrintTicket.PageMediaSize of the PrintQueue. While this will set the selected value to the DefaultPrintTicket.PageMediaSize just fine it does not set the initially s...

WPF Toolkit DataGrid - Finding only visible/currently viewable rows

I'm using the WPF Toolkit's DataGrid to display a set of search results. As per then scenario in my other question I want to be able to pre-fetch secondary results for each of my viewable (that is, within the visible scroll area) rows in the datagrid. I want to be able to: Query "viewable" rows Raise an event when rows become visible ...

Creating Bordless Windows with custom visual

Hi I'd like to create a custom window using WPF that doesn't look like the regular window. The window I want to create is similar to MacOs window, with title centered (with dropshadow effect), and controls button on left side of the window. I did create a bordless window, but some questions I have: 1 - How can I set it functionality o...

WPF Choppy Animation

WPF Windows-XP SP3 I'm having a problem with a simple WPF animation. I use the following Xaml code (in XamlPad and also in a WPF project): <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Border Nam...

display Icon in wpf Image

I have a wpf application that needs to extract the icon off of an executable I found here that i can do this Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName); but when I try to set the source of a wpf Image I get "Cannot implicitly convert type 'System.Drawing.Icon' to 'System.Windows.Media.ImageSource' Any sugg...

Shorter Binding expression with validation

Hi, I'm repeating same binding parameters for every textbox and they're quite long strings (which is not good for many reasons). And I'm wondering if there's a way to make them shorter? For instance all my controls on forms are using the following binding template: Text="{Binding SourceProperty, UpdateSourceTrigger=PropertyChanged, Va...

basic WPF slider question

I'm using a slider control in WPF to show how much of a file has been read, and to control where to read the file from. The slider binds its Value to a int ProgressValue. I use a timer to look at the current read percentage and set the ProgressValue appropriately. The slider moves to the desired position. As more of the file is read,...

Ribbon based GUI - Winforms vs WPF

For a new project, I'm writing an administrative tool as a client software. So far, I've only written some small winforms application with a 'old-lookin' GUI. I'm thinking of something fresh, new looking like ribbon based design. The questions that come into my mind are: 1) Should I prefer WPF over Winforms for a ribbon based GUI(thou...

Specified Visual is already a child of another Visual or the root of a CompositionTarget.

WPF Visualizer Visual Tree canvas canvas.Children.Add poly |> ignore Specified Visual is 1) already a child of another Visual or 2) the root of a CompositionTarget. Don't think it's 1), not sure what 2) is? Using Visual Studio 2010, F# 2.0, WPF, ... not XAML ...