wpf

How do I check for when my control obtains or changes the visual parent?

I want to hook my control's visual parent's events. ...

What's the best way to replicate the functionality of a Windows Explorer folder UI in WPF?

So I'm using FileSystemWatcher to populate and update a playlist. I want to replicate many features of Windows Explorer, most importantly: * inline rename * slow double click to rename I'm having quite a hassle doing this, so I thought, maybe there's an easier way than reimplementing the wheel? Maybe I can somehow host a Windows Explo...

How to use MVVM and MEF with DataTemplate?

I am trying to use MEF on a new project within my application. Things work at the main app level, but in this separate project whose assembly is included in the main app (its a UserControl) I am wondering about something... If I have a UserControl, and in it I have the following: <UserControl.Resources> <DataTemplate DataType="...

How to stop a WPF Listbox from scrolling

I want my listbox to never scroll. It's easy to just hide/disable the scrollbars, but mousewheel/arrow keys still cause a scroll when the items in the ListBox exceed its boundaries. There HAS to be some way to tell the ListBox that it just can't ever scroll....right? ...

wpf prism composite command

I have a composite WPF application. I am planning to implement tool bar functionality . There are few toolbar items ( basically print,save , hide , expand , undo) which will be common to all views in the main region. For this i have created default toolbar module which will add these items ( print,save , hide , expand , undo) to the to...

Simple CRUD work with WPF and data binding.

I'm new to WPF for Windows application development, just wanted to put that out there first. I'm using Visual Studio 2010 and .NET Framework 4.0. I'm working on a rather simple administration tool. For simplicity sake lets say I'm working with Employee data. I've created a little UserControl called UserDetail that has all the fields ...

Changing tab item of tabcontrol on design view

I'm trying to add control to another tab item on design view, but I can only see the first tab item with all the controls I previously added and at the moment I can only add controls by hard coding on code view window, therefore I have to compile the program in order to see the results of the controls added by hard coding. Any help woul...

Implemeneting a multidock window system (like blend, visual studio) in WPF

How would you go about to implement a docking toolbox windowing system as seen in Expression Blend where you can dock toolbox windows in a lot of ways beneat each other, overlapping as tabs or as floating top level windows. My system should behave pretty much the same as in Expression Blend. Also the way I get visual cues where the toolb...

Child docked window

Greetings, I would like to have child window docked next to my parent window. If I move parent window, child window should be also moved. This image should explain what i would like to achieve. Can someone help me please. I'm writing in WPF. Does anybody has an idea how to do this? ...

Is the hotspot of the WPF Cross cursor in the middle of the crosshair?

I'm having amazing difficulties with a high-precision pixel-oriented image program in WPF and starting to suspect that the Cursors.Cross cursor hotspot is not at its centre, as you would expect. I'm debugging using Magnifier at 16x and mouse set to the lowest acceleration. The code is based on DrawTools from CodeProject. Is this the ...

Styling both Hyperlink and TextBlock with a single style?

I have two types of text that need to follow similar coloring rules based on an enumeration: public enum Modes { A, B, C } A Style with DataTrigger markup is used to colorize: <Style TargetType="SEE BELOW" x:Key="Coloring"> <Style.Triggers> <DataTrigger Binding="{Binding Path=.}" Value="...

IsDirty implementation for WPF

Hello Does anyone have an IsDirty implementation they find particularly useful? Ideally I'd like to support Undo but not have to lug a framework like CSLA in. I'd also prefer an implementation that favors composition over inheritance. I'm working with WPF with a ViewModel slant right now (INotifyPropertyChanged). The last SO question I...

How to expose xaml properties?

I created a ComboBox subclass and added my functionality. Now I want to expose external properties of the TextBox for example: <a:MyComboBox SpellCheck.IsEnabled="True" TextBox.SelectedText="{Binding X}" /> Is this possible, I maybe didn't choose the wrong particular property but I guess you understand what I mean. Is this possible?...

How to Read and Edit IPTC "Writer/Editor" tag using WPF

Hello, I am creating a WPF application that can read and write IPTC and XMP image metadata. I am having problem reading and writing the IPTC Writer/Editor property. The XMP counterpart of it works fine. I have tried the following options but no luck. metaData.SetQuery("/app13/irb/8bimiptc/iptc/Writer/Editor", value) metaData.SetQuery...

I have a context menu which is being shared by 6 different labels, how can I tell which label is using the current instance of the context menu?

Here is the xaml for the contextMenu: <Window.Resources> <ContextMenu x:Key="IBContextMenu" x:Shared="true" Name="IBContextMenu1"> <MenuItem Header="Edit" Click="ibEdit_Click" AllowDrop="False" /> <MenuItem Header="Clear" Click="ibClear_Click"/> </ContextMenu> </Window.Resources> Both the edit and clear ite...

Grouping child objects in WPF TreeView

I am trying to get my tree view to group a collection of similar items by what they are. To keep things generic, my object hierarchy could look like this: Objects Object Group #1 Item #1 (Type 'A') Item #2 (Type 'A') Item #3 (Type 'B') Item #4 (Type 'B') Right now my TreeView shows these objects exactly like the object ...

WPF: The Icon property in the Window is crashing the application in Windows XP SP2.

Suppose I have this: <Window stuff Icon="Resources\myicon.ico"> If I run the program on Windows 7, it's fine. If I run it on Windows XP SP2, it crashes. Removing the Icon property, it works fine on Windows XP, but then it doesn't have my myicon on the Windows 7 taskbar or on the Window. Also, setting the application icon on the VS pro...

WPF ColorAnimation for a Brush property

Hi, I wonder if someone can help me - I've got a label which I need to be able to cross-fade between any 2 colors when a method is called in the code behind. My best attempt so far: Private OldColor as Color = Colors.White Sub SetPulseColor(ByVal NewColor As Color) Dim F As New Animation.ColorAnimation(OldColor, NewColor, New Dura...

Is there a significant performance cost to DynamicResource instead of StaticResource?

Our designer is using Blend to style our WPF application. When he chooses local resources for properties, Blend will apply them as a {DynamicResource} instead of a {StaticResource}. My guess is that Blend does this because it enables the app to be re-themed at runtime without having to restart it. My question is: is there a significant ...

How do I explicity call ItemsCollection.Filter?

How do I explicityl call something like 'DoFilter' on System.Windows.Controls.ItemCollection? I set up it's Filter property to a Predicate. I placed a breakpoint in the predicate, it reaches there only when the ItemsCollection is initialized, when I call m_ItemsCollection.Refresh() it's not. ...