wpf

Get the ListBoxItem in a ListBox

I am trying to change the Control template on a ListBoxItem when It is selected from the ListBox. To do so, I was going to get the selected ListBoxItem from the ListBox itself, and set the control template on that. How would i go about doing this? I have tried, SelectedItem and that returns the bound object within the ListBoxItem. ...

WPF, Flash and bad pointer(accessViolationException) problem

public partial class MainWindow : Window { private FlashControl flash = null; private Timer timer; private WindowsFormsHost host = null; private bool first; private delegate void myDel(object state); public MainWindow() { InitializeComponent(); first = true; timer = new Timer(new Timer...

MultiBinding and IMultiValueConverter Convert() called only once

Q: Why does my custom TextBox UserControl using a MultiBinding and IMultiValueConverter gets its Convert() method called only once (during instanciation) ?? I have defined a UserControl that requires a MultiBinding and a IMultiValueConverter in order to change its behavior/presentation upon 2 indenpendant DependencyProperty. <proj:MyCo...

How to save PNG8 with matte using WPF?

I want to be able to dynamically generate PNG24 and PNG8 images using WPF. I was able to generate the PNG24 image that I want using the following code (simplified for the example): var targetBitmap = new RenderTargetBitmap(128, 16, 96, 96, PixelFormats.Pbgra32); var drawingVisual = new DrawingVisual(); using (DrawingContext context = d...

Castle dynamic proxy and INotifyPropertyChanged on WPF

I'm wrapping my entities with a proxy using Castle DP, my entities implement by themselves INotifyPropertyChanged. and raise the event when set is called. i wrote some unit test on the wrapping to see that the propertychanged event is fired when i manipulate entities through the proxy and they all passed. the problem is on a real appli...

WPF/XAML TreeView doesn't Hightlight Nodes after Binding

So I am having an issue with the TreeView. If I build a tree view statically, every node in the tree is selectable in that when I click on it, it highlights itself blue, indicating that node is selected. <TreeView Grid.Column="0" Grid.Row="2" MinHeight="100" MinWidth="100" BorderBrush="White" DataContext="{Bind...

mef and windowsAPICodepack

Hi stackoverflow fellas, I've got a problem which at first looks solved but I can't get it to run. I've got one WPF application project in my solution and a WPF class library which is added at runtime via MEF. In this external Dll I use the TaskDialog of the Codepack. Ok I found the manifest dependency thing and added it to my main WP...

Splitting a WPF PathGeometry into "tiles"

I have a rather large PathGeometry (over 100,000 points and stroked but not filled) to display for the user, but only a small portion of the path will be visible at any one time. To clarify, the path itself is not predetermined but will be created from data. The problem: I want to provide very smooth panning so the user can explore are...

Styling a groupbox in WPF

How can I set the opacity of the background for a groupbox etc. The code beneath doesn't compile: <Style TargetType="GroupBox"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Opacity="0.5">White</SolidColorBrush> </Setter.Value> </Setter> </Style> ...

Don't highight selected cell when user clicks in a data grid row.

I have a DataGrid that is setup like this: <DataGrid AutoGenerateColumns="True" GridLinesVisibility="Horizontal" IsReadOnly="True" ItemsSource="{Binding Documents}" SelectionMode="Single" SelectionUnit="FullRow" /> Can somebody point me in the right direction for making the UI look as t...

XAML Security, Injection, In-Place Editing

I'm working on a new WPF application and we've been experimenting with some attached / dependency properties and triggers to do some things in our XAML. The question came up the other day about the ease of editing xaml in an existing executable. Similar to an IL dump / injection, If someone could export xaml, edit it, and re-package it s...

WPF ScrollViewer - Align Horizontal Scrollbar to top?

Hello! I am wondering if it is possible to dock the horizontal Scrollbar in the ScrollViewer control to the top rather than have it on the bottom? If not, would it be possible to use a whole separate Scrollbar control placed above the ScrollViewer and somehow assign the ScrollBar_Scroll events to it? Thanks in advance! ...

Populating a WPF listbox with items from an SQL (SDF) database

Hi! I have been searching on how to do this for a very long time, and I have not managed to get a straight answer on the subject, so hopefully one of you StackOverflow users will be able to help me here. I have a WPF ListBox named CategoryList and a SDF database called ProgramsList.sdf (with two tables called CategoryList and ProgramsLi...

Dynamic Drop Shadows in WPF?

Ok I feel like I am just missing something small here, but it has taken me too long to figure this one out. I have a custom UserControl that has a drop shadow. This UserControl is then used as the view to create a ModelUIElement3D. The drop shadow works perfectly when first displaying. The trick here is that I want to be able to change ...

Integration Testing a ViewModel that calls WCF Services asynchronously in a WPF MVVM Application

The Silverlight Toolkit contains Unit Testing Functionality that allows to test classes such as the ViewModels in a MVVM application that invoke remote Services asynchronously. I would like to be able to perform my ViewModel Integration Tests against the actual services instead of mocked instances. Is there any support for asynchrono...

Is there a WPF control that can perform CRUD operations a Domain Model?

I am tasked with writing a WPF app that performs crud on 100 or so odd tables that are related. I would have to write everything by hand. My goal is to put a control in a WPF window, point it to the Domain Model and control allows users to perform CRUD operations. Are there any out there that exist. I have spent some time looking...

Drawing and removing shapes in WPF

In GDI+/WinForms, I could do this in the Click() event and using the graphics Object: AddPoint(p); //Add Point contains some code to make sure there is only 3 dots foreach (Point p in PointList) { DrawRectangle(p); } Invalidate(); If I try something similar in WPF, it won't cleanup the dots I created (I'm guessing because of how W...

Filtering animals using wpf radiobuttons

I am playing with a sample WPF application that is tiered in a Model-View-Presenter manner. The Model is a collection of Animals which is displayed in a view via binding to properties in a presenter class. The XAML has an items control that displays all the animals in a model. The model class has a boolean attribute called 'IsMammal'. ...

Visibility Binding using DependencyProperty

I've some simple code below that uses a ToggleButton.IsChecked property to set the Visibility of a TextBlock. It works fine. Since this doesn't quite fit in with my program's structure, I'm trying to bind the visibility of another TextBlock to a DependencyProperty of "this". It compiles fine, but it produces no effect. I'm doing some...

Find Bound Item from TreeViewItem from ContextMenu

I have this Tree View that looks like this: <TreeView Grid.Column="0" Grid.Row="2" MinHeight="100" MinWidth="100" BorderBrush="White" DataContext="{Binding Projects, Source={x:Static SizingApp:Manager.Instance}}"> <T...