wpf

What is the most enjoyable literature that is also useful for developers at a technical level?

I just spent some time at Bart de Smet's online blog and found it to be not only useful information for developers but at the same time interesting, fun, reading. The author obviously not only knows his subject matter, but has a talent for making his writing enjoyable to read: ...80 centimeters behind me lies the answer in dead tre...

.NET WPF - System.Windows.Controls.TreeView Adding SubItems

After you have added Items to the "root" level of a System.Windows.Controls.TreeView, what is the proper way to add in "subitems" by name? System.Windows.Controls.TreeView.Items <-- doesn't seem to have a Find() or [] by name. UPDATE: Oh, wait... is it TreeView.FindName() ? Actually looks like FindName won't work because it returns ...

How can I determine bounds of a WPF control in C# at runtime?

I have a Window with several Frame controls and would like to find the Bounds/Rectangle of the controls at runtime. They go into a grid on the window using XAML with Height/Width/Margin attributes. The Frame control doesn't have Bounds, Rect, Top or Left properties. The purpose is to test each frame to see if the mouse is inside when ...

c# WCF host.open failing

I am doing a WPF application and it is also a WCF server, the problem I have is that I need the ServiceHost to be open and listen in a port for the clients and accept requests as soon as it starts, but the problem I have is that if I write the code to open the host host.open in the constructor after the function this.InitializeComponent...

RichTextBox (WPF) does not have string property "Text"

Hi, I am trying to set/get the text of my RichTextBox, but Text is not among list of its properties when I want to get test.Text... I am using code behind in C# (.net framework 3.5 SP1) RichTextBox test = new RichTextBox(); cannot have test.Text(?) Do you know how come it can be possible ? thanks, ...

WPF Force rebind

I have an object that can't inherit DependencyObject OR use NotifyPropertyChanged, and I've binded it to quite a few controls, so when the properties change, I don't want to go to each control and change it's value on the code, so I'm thinking there must be a way to tell the XAML to "Rebind" all that it's bound to with one or two lines o...

Can you print a Flowdocument Table in WPF with repeatable table column headers

How can you print a Flowdocument Table in WPF with repeatable table column headers? I have seen this one [http://www.codeproject.com/KB/WPF/PimpedDocumentPaginator.aspx] and it does not work. ...

Displaying a data-bound StackPanel inside a DataTemplate

I have objects I'm databinding to a ListBox in WPF. Here's what the end result should look like: ------------------------------- | Name | Opt1 | Value1 | | | Opt2 | Value2 | | | Opt3 | Value3 | | | Opt4 | Value4 | ------------------------------- Essentially i've got a DataTemplate for the ov...

WPF - TreeView.FindName() problem

How come TreeView.FindName() can find things added to the Xaml doc at compile time but not dynamically added at runtime? ...

How to create DataSource dependency property on a wpf User Control

I have a user control that wraps a grid. I want to be able to set the underlying grid's data source, but through the user control, like this: <my:CustomGrid DataSource="{Binding Path=CollectionView}" /> I have set this up in the grid like this: private static readonly DependencyProperty DataSourceProperty = DependencyPr...

WPF composite Application - tab region - view not getting focus

Hi, I'm just starting to use the composite application libraries for WPF. In my shell I have a region in a tabcontrol that is used to display different types of views. I also have a toolbar with buttons hooked up to commands, for example save. The commands are bound in my views, and the views have the canExecute and execute methods. T...

WPF, Flash and Airspace

Has anyone been able to solve the airspace issues when trying to play a flash (swf) movie in a WPF application? I've been able to play the swf file using a WinForms control and a WindowsFormsHost element, and also using the WebBrowser element - but both have the airspace issues. ...

How do I attach commands to the checking and unchecking of a CheckBox?

In my ViewModel I have two commands: ICommand ExecuteMeOnCheck { get; } ICommand ExecuteMeOnUncheck { get; } I wish to attach these commands to a CheckBox and have one of them execute when it is checked and the other execute when it is unchecked. What's the best way to achieve this without cluttering the View with code-behind? ...

WPF: Trigger a content resize with GridSplitter

I'm trying to force a grid/expander to reevaluate whether it needs a scrollbar, as it's showing emptiness. I'm using this layout: <Grid> <toolstrip /> <!-- fixed height row --> <Scrollviewer> <!-- * height --> <Grid> <!-- all rows are 'Auto' height --> <Expander /> <Expander> <!-- this one stretches far too high --...

How can I make a WPF Image disableable?

I need an Image that is grayed out when disabled (IsEnabled=False). A grayed out version of the image can be produced by reading the BitmapImage into a FormatConvertedBitmap which is shown here. I have been able to get this working with a UserControl but now I would like the same behavior in a specialized Image class for more flexibilit...

(WPF) How do you bind to IsMouseOver on a usercontrol

Edit: The original premise of the question was incorrect so revised the question: Basically I want a button to be visible only when the mouse is over the containing user control. Here is the simplified versin of what I have: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas....

Migrating asp .net 2.0 application latest .net version(design question)

Hi I have a web application built in the asp.net 2.0 MVC pattern. Now the clients want to update this application with rich UI experience and the latest .net technologies. Can anyone suggest whether I should use WPF or Silverlight: which one should I choose to change the application per the client requirement? I should be able to re...

In WPF, after DoubleAnimation UIElement property cannot be changed?

OK, I'm making a GUI for my MP3 player using WPF and I have a border that enlarges its width property for every second of the played track, thus making a "Progress Bar" for the currently played song. I named the border ProgressBarBorder. After the whole playlist is complete, I wanted to use a DoubleAnimation to fade out the border. Now, ...

Using Silverlight 3 to make a WPF Application cross platform (Windows + OS X)

Im writing a Twitter Client in C#/WPF/WCF. I(Windows) showed some of my friends(OS X) and they would also like to use it. Would it be worthwhile to convert the application into Silverlight 3 so that they would be able to run/install it on OS X? Will the full features of Silverlight 3 be supported on OS X (like the install feature), li...

Animated transitions in WPF

I can't figure out what I'm missing here. Here's the problem: Consider a (Control|Data)Template with a Trigger that switches visibility of some inner UI elements. E.g. show a TextBlock when IsReadOnly==true and show a TextBox when IsReadOnly==false. Everything is perfect if you do this without animation - one or two setters would do th...