wpf

WPF App - How to obtain a reference to the corresponding System.Windows.Forms.Form?

In my WPF Project I have a WPF Window. I want to use Sticky Windows Solution in my WPF Project. The library wants only one parameter: the System.Windows.Forms.Form object. Does it exist any way to obtain a Form object starting from a WPF Window object? ...

Why does my PictureBox loading routine leak memory?

I've been trying to swap images in a PictureBox in a C++/CLI application but my solution appears to have a memory leak: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { // Pick a new bitmap static int resource = IDB_BITMAP1; if( resource == IDB_BITMAP2) { resource = IDB_BITMAP1; } else { resource =...

Master Detail MVVM WPF not working

Hello Guys, I am unable to get my bindings working on the Detail ListView. I have pasted all my MVVM pattern code below. Please help!!! My View : DirectoryDetailView.cs > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <ListView Grid.Column="0" ItemsSour...

Cannot databind DependencyProperty

Hi all I have a UserControl with a DependencyProperty. I set it's value in the host window using a data binding expression. However, it doesn't work as expected. Snippet from the user control's codebehind: public class ViewBase : UserControl { public static readonly DependencyProperty ViewModelProperty = DependencyProperty...

[WPF] Button turns invisible on Windows 7 machines without Visual Studio installed

We have a window that displays fine on all of our Windows 7 development machines with Visual Studio but not on the ones without Visual Studio installed. We have a simple OK/Cancel button pair and on the affected machines the OK button is invisible but if you click in the place where it should be it still works. Here are the styles used:...

How to keep an area a constant/relative size while user expands/collapses treeview?

I have a window that will be a variable size, currently it is 300 x 400 as shown below. In the top part I have an expandable tree view In the bottom part I have a long horizontal panel with a button in it. I want the top area (treeview) to be about 95% of the height, with the button tool area a constant 50 high. I want these proportio...

How can I get MouseLeftButtonDown to work on TreeViewItem like it works on TextBlock?

How can I attach a click event on to a TreeViewItem? The following works for the TextBlock but not the TreeViewItem: XAML: <Window x:Class="TestClickTree2343.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="...

How to change the color/opacity of the triangular icon on a TreeViewItem?

Some of my TreeViewItems are clickable and some are not. For those that are not clickable, I changed the Foreground color to gray. However, if that item has children, I want to also change the little triangular bullet to gray. How can I do that, something like this: //PSEUDO-CODE: <TreeViewItem IconBulletEnabled="False" IconBulletCo...

How do I bold portions of a bound TextBlock?

I have a TextBlock bound to a property. However, I'd like to bold certain words within the text. What is the easiest way to do this? FYI, I'm new to WPF. ...

Missing features in WPF

I have been using WPF for a while now, and while I'm finding it excellent generally, I find it is still missing a number of features. I would like to use this question to compile a list of the most wanted WPF features, and hopefully provide some workarounds. Please only post one feature per reply so that people can vote. Maybe MS are li...

Aggregate detail values in Master-Detail view

I have a master-detail relationship in some custom entities. Say I have the following structure: class Master : INotifyPropertyChanged { public int Id { get; set; } // + property changed implementation public string Name { get; set; } // + property changed implementation public ObservableCollection<Detail> Details { get; ...

Need help with a custom Style in WPF

I'm attempting to build some simple custom styles for the WPF Toolkit DataGrid control. I have a style for the overall DataGrid and a style for the DataGridColumnHeader. I am not setting any control templates, only basic properties. Here is what my sample DataGrid looks like with my custom styling applied: The header has the gradien...

Merging software for xaml

For you wpf silverlight people who are working with source control that allows merging. What is the best software to use for merging? I am more worried about the xaml then I am the code because this has the potential to change the most during a merge. ie beyond compare, kdiff etc... ...

Scaling/resizing the diameter of all bubbles on a bubble chart (in WPF or Silverlight)

I have a bubble chart in a WPF application with LOTS of points in a BubbleSeries. The automatically drawn sizes of the bubbles result in so much overlap of the plotted bubbles, that most of the bubble points are obscured. The drawn bubble size does not change if I alter the data reduce the SizeValues of all the plotted points (some sort ...

Passing Click Events in Composite WPF/XAML Controls

So, let's say I have a DataTemplate <DataTemplate x:Key="ProjectsDataItemTemplate"> <ComboBoxItem x:Name="ProjectComboBox" Opacity="1" HorizontalAlignment="Stretch" Foreground="#FF80BBD2" VerticalAlignment="Center" VerticalContentAlignment="Center" Background="Transparent" Style="{DynamicResource ComboBoxItemStyle1}"> <StackPanel> ...

Reusable Custom Content for Buttons

My user interface makes use of customized buttons: They contain both an image and a label. I customized a single button manually, by setting its content to a grid holding an image and a label. However, since I need to have several such buttons, with different images and labels, I'd like to "extract" this pattern into something reusable...

Binding WPF ComboBox to entity.

Ok, Ive searched the heck out of the Interwebs and can't seem to find this right. I have a ComboBox that is bound to a CollectionViewSource of EntityFramework entities. The display is a template that shows the first/last name. The problem is, when an item is selected, the Display of the combobox == the object.ToString() (i.e. MyCompan...

ASP page scraping in wpf

I want to scrap the content of an asp-based web pages from WPF application, and I want to know what is the best way is it using WebBrowser control? or is there a lighter way to do that? Any thoughts? ...

MVVM, WPF, and Validation

Well, I think i have a fairly good understanding of MVVM. But I need some clarifications. Is the ViewModel responsible for calling the appropriate service to persist model information? If so, then the ViewModel must have a clean way of determining if the data it holds is valid. If the data is valid, it will update the model accordingl...

Non-resizable windows with windowStyle=None

Basically, I want to create a window that looks like the following: However, the window shouldn't be resizable (the one in the screenshot is) but must retain the glass border. The XAML for the window in the screenshot is as follows: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schem...