wpf

WPF and Very Large Images

Is there anything I can do to help manage the sheer amount of memory WPF uses to render huge images - potentially anything up to 10,000 x 10,000? I need to maintain the quality as zooming is key, but loading the Image control seems to require anything from 50 - 700MB of memory usage :S I'm not doing anything particularly clever with lo...

WPF TreeView PreviewMouseDown on TreeViewItem

If I handle the PreviewMouseDown event on TreeViewItem, I get events for everything I click on that TreeViewItem include the little +/- box to the left (Windows XP). How can I distinguish that? I tried the following: // We've had a single click on a tree view item // Unfortunately this is the WHOLE tree item, including the +/- // symbo...

WindowStatupLocation = CenterScreen is not working correctly in WPF

In the properties for the parent window I set WindowStatupLocation=CenterScreen In the properties for the Child window I set WindowStatupLocation=CenterOwner on the button click in the parent window if i show child window, the child window position is not center owner. Is this is a bug in WPF or I am doing something wrong? ...

Is it possible to disable a ScrollViewer from inside the ScrollViewer?

From a UserControl, I would like to disable a ScrollViewer which is defined one level higher. My scenario looks something like this: <!-- ... --> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <custom:MyUserControl ... /> </ScrollViewer> Now, I would like to disable the Scr...

Displaying FontFamily in Combobox

Hi. My goal is to manipulate the text-styles of my application via DependencyProperties. I got a diagram in which the texts are to be manipulated in size, fontfamily, color, etc. So I'd like to use an interface similar to a rich text editor like Word. I'm using this code in my TextStyleVM http://shevaspace.blogspot.com/2006/12/i-have-s...

WPF CheckBox style with the TextWrapping

I need you a TextWrapping in the WPF CheckBox. Please look at this two samples: <CheckBox> <TextBlock TextWrapping="Wrap" Text="_This is a long piece of text attached to a checkbox."/> </CheckBox> <CheckBox> <AccessText TextWrapping="Wrap" Text="_This is a long piece of text attached to a chec...

WPF MessageBox close without any action

Hi, I have a confirmation message box for the user in one of my apps. Below is the code for that, MessageBoxResult res= System.Windows.MessageBox.Show("Could not find the folder, so the D: Drive will be opened instead."); if (res == MessageBoxResult.OK) { MessageBox.Show("OK"); ...

How can I make a WPF TreeView data binding lazy and asynchronous?

I am learning how to use data binding in WPF for a TreeView. I am procedurally creating the Binding object, setting Source, Path, and Converter properties to point to my own classes. I can even go as far as setting IsAsync and I can see the GUI update asynchronously when I explore the tree. So far so good! My problem is that WPF eage...

System Tray Popup Windows 7 Style

Hey All, I want something like this: This window is not resizable, and aligns itself above the system tray icon which it is related to. I have this: Which is resizeable, and it goes wherever it feels like. If you click the volume control in Win 7, it always pops up directly above the icon. This is ideal. I've found this referenc...

System Tray Application and Memory Footprint

Hello everyone, I have created a small application that, basically, exists in the system tray and the user only needs to open the actual application in VERY few cases. The problem is, that once the suer opened the application for the first time, the memory is filled up with an awful lot of data (WPF UI for datagrids, treeviews etc). But...

MVVM and avoiding Monolithic God object

I am in the completion stage of a large project that has several large components: image acquisition, image processing, data storage, factory I/O (automation project) and several others. Each of these components is reasonably independent, but for the project to run as a whole I need at least one instance of each component. Each componen...

Take Screenshot of current user control or any GUI in Silverlight 3

Hi all, I would like to ask if it is possible to take screenshot of current user control programmatically and save as a file in silverlight 3. I found some ways to save as an image file for a Canvas in silverlight 3, but how about user control or childwindow ? Thanks, ...

Custom Fill Property on PathGeometry in Silverlight

I've been looking at (and getting confused by) Dependency Properties - I'm not sure if this is what I need or if there is something else. I'm looking to something very specific with <Path.Data/> children in Silverlight, in particular <PathGeometry/>, <EllipseGeometry/>, etc. While the <Path/> element has a .Fill property, I'd like to a...

Sometimes my dropdowns/datepickers will stop functioning?

Q: Where should I check to track this down? Issue: Opening a view model in my application sometimes makes dropdowns/datepickers nonfunctional. ie. dropdown won't drop and the datepicker calendar won't come up I suspect a binding issue but don't see one. Dropdowns have normal things like strings, numbers. One drop has a list of mi...

WPF: Convert VisualBrush to Drawing?

Hello, I have a VisualBrush and need this VisualBrush as a Drawing. Anyone knows how this can be done? Thanks for any hint! ...

Looking for a chart of Wpf Bindings

I'm probably typical in being bewildered by the many syntaxes of Wpf binding. Does anyone know of a chart that lays out all the possibilities. Across one axis is all the variations of binding syntaxes (Static, Dynamic, Self, ...), the other axis are all the variations of scoping and type. The intersection of the axis show an example. Su...

WPF binding fails with custom add and remove accessors for INotifyPropertyChanged.PropertyChanged

I have a scenario which is causing strange behavior with WPF data binding and INotifyPropertyChanged. I want a private member of the data binding source to handle the INotifyPropertyChanged.PropertyChanged event. Here's the source code: XAML <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="htt...

WPF binding problem

I've got some bindings in UI: <Window x:Class="Tester.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="377" Width="562" xmlns:my="clr-namespace:MyApp"> <Grid> <TextBlock Text="{Binding...

xaml nested class path designer issue

Hi, I have nested class public class Enums { public enum WindowModeEnum { Edit, New } } In my xaml I reference code: <Style.Triggers> <DataTrigger Binding="{Binding WindowMode}" Value="{x:Static Types1:Enums+WindowModeEnum.Edit}"> <Setter Property="Visibility" Value="Collapsed" /> ...

What am I doing wrong with my ItemsControl & databinding?

I'm reworking my simple hex editor to practice using what I've recently learned about data binding in WPF. I'm not sure what I'm doing wrong here. As I understand it, for each byte in the collection "backend" (inherits from ObservableCollection), my ItemsControl should apply the DataTemplate under resources. This template is just a text...