wpf

WPF Adorner Visibility Data Binding programmatically

Hello, I'm creating a Loading Adorner that has a swirling icon over it. I tried binding the visibility property directly in the XAML but that actually hides everything inside its hierarchy. I have this in my XAML: <AdornerDecorator Visibility="{Binding Path=RootGroup.Loading, Converter={StaticResource VisibilityConverter}}"> <TreeV...

Bubbling Events not Occurring

Hello All, In the code below, I am seeing the tunneling events occurring but am not seeing the corresponding bubbling events occurring. Why might this be? Thanks, Dave <Window x:Class="TestRoutedEvents.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml...

AvalonDock dock a window.

Hello, I am trying to convert my app in WPF to work with AvalonDock. I have a few windows(about 10) and main form that has DockingManager. I would like to put those windows inside that DockingManager. I've tried this: <ad:DockingManager x:Name="MainWindow"> <ad:DocumentPane x:Name="Windows"> </ad:DocumentPane> ...

From Winforms to WPF time?

We are a team of .net winform and asp.net developers building custom enterprise applications for organisations mainly in the public sector. Is it time to retrain/retool the team in WPF/Silverlight? How to make management, in first place and clients second buy the idea? ...

TreeView, Overiding the double click mouse event WPF

Hi. I was wondering, what will be the best way to override the Tree View's mouse click? As you know when you double click a tree view parent, then the tree view expands and shows the children. If it doesn't have any children then it doesn't do anything. but if it is already expanded, it will the collapse. I want to take the tree view,...

WPF style causing loop

Why does the following XAML cause a stack overflow exception with some themes? <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ExpressionLight.xaml"/> </ResourceDictionary.MergedDictionaries> <Style x:Key="BaseButtonStyle" TargetType...

WPF: Progress bar with indeterminent duration?

In WinForms you could set a progress bar to loop endlessly to indicate that you don't know how long it will take. How would I do that in WPF? ...

WPF: Setting a binding for all TreeViewItem instance

Greetings, I'm using WPF with a Model-View-ViewModel pattern, and I have a view model with an IsSelected property which I want to bind to a TreeViewItem's IsSelected property for all TreeViewItems in the scope. I'm attempting to do this with a Style and a Setter. This works apparently for the root-level TreeViewItems, but not for their ...

WPF: how do I load user controls dynamically?

How can I load WPF based user control in WPF based window dynamically (using code at runtime)? ...

How to directly access the UI thread from the BackgroundWorker thread in WPF?

I'm creating a backup utility in WPF and have a general question about threading: In the method backgroundWorker.DoWork(), the statement Message2.Text = "..." gives the error "The calling thread cannot access this object because a different thread owns it.". Is there no way for me to directly access the UI thread within backgroundWorke...

Why does a string INotifyPropertyChanged property update but not a List<string>?

In the following WPF application, when you click the button, why does TheTitle TextBlock update but FilesCopied ListBox not update? XAML: <Window x:Class="TestList3433.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300...

How do I remove the icon and title from a WPF Window but display it in the taskbar?

I'm trying to create a WPF window, which has no icon and no title displayed in the titlebar. I already found some examples how the icon can be removed (for example here), but all these solutions work if I'm debugging the application in Visual Studio but they don't work when I'm just running the executable. I would also like the title n...

Desktop screenshot in WPF

How can I take a screenshot of the desktop in WPF? Preferably with the mouse cursor showing. ...

WPF Images - Trying use to use treeview, but can't get background to be clear

Greetings, I have a TreeView containing a set of TreeViewItems - Each TreeView is pretty simple (just some text, plus an image) - The images are usually folder & files icon. All good and simple...except for the fact that since the contents of images do not fit an exact square, there is some white background surrounding portions of each....

WPF data binding - DataGridComboBoxColumn and ObjectDataProvider

I'm trying to code a WPF 4.0 DataGrid that matches a database table, with two entries in particular GroupID and SectionID... GroupID contains a collection of groups, and SectionID should be built from a table that takes a {GroupID, SectionID} keys and returns section information. Binding the DataGridComboBoxColumn to the groups table to...

How do i create a custom button in blend from Expression Blend?

I have created an image in Expression Design that I'm trying to import into Blend to create a button. I'm trying to make the button scale with it's container (most likely a grid) when i resize it in Blend. Unfortunately, the documentation for both products isn't very helpful. The xaml in design looks like the following: <Canvas xmlns="h...

WPF: How to accept both string and FrameworkElement in dependency property (like wpf Label does)?

Hi, I am creating a custom WPF control that should have several content slots. I'd like the user to be able to use either string, or a FrameworkElement as a value of property, for example: <!-- MyHeading is a string --> <MyControl MyHeading="Hello World" /> <MyControl> <!-- MyHeading is a FrameworkElement --> <MyControl.MyHeading> ...

WPF ToggleButton and DelegateCommand

Hi, Is there a way to determine if a ToggleButton is Checked/Unchecked via DelegateCommands? TIA, mike XAML code below. I'm using ItemsControl and binding to a collection. I'm basically wanting a way to get the toggle status of each button when it's clicked. <ScrollViewer VerticalScrollBarVisibility="Auto"> <ItemsControl It...

wpf binding when using datatemplate

ok currently i have this piece of code: <TabItem Style="{DynamicResource MyStyle" x:Name="TabCustomers" Padding="0,1,4,1" Header={Binding Path=customersHeader}/> Now i want to add an icon there so I do (by removing the header above): <TabItem.Header> <StackPanel Orientation="Horizontal"> <Image Stretch="UniformToFill" Source="{...

HierarchicalDataTemplate and HeaderedItemsControl with ControlTemplate fails to show nested data...

I can get this pattern to work with Menu and TreeView but I must be missing something when I make an attempt with HeaderedItemsControl: <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" > <Page.Resources> ...