wpf

Storyboard.GetTarget in Silverlight for Windows Mobile

I have a problem with WP7 app. I'm trying to write WP7 app form WPF sample code. private void storyboard_Completed(object sender, EventArgs e) { ClockGroup clockGroup = (ClockGroup)sender; // Get the first animation in the storyboard, and use it to find the // bomb that's being animated. DoubleAn...

How can I calculate the VerticalOffset at which an index would be vertically centered in the viewing area of a textbox?

I am working on adding find and replace functionality to a text editor that I am building and I would like to be able to scroll the textbox so that the selected match is vertically centered on the screen. ...

Storyboard - No completed event

Hey. This is probably a simple question, but how do I know when a Storyboard animation has completed? I'm using .Net 3.0 so maybe that's why, but in my other projects (.net 4), there was a simple Completed event I could handle. What's the way to do it in WPF with .net 3.0? Thanks edit in response to comments: I guess the error lies e...

textbox - text centering

Hi Is there any simple way to center a text in textbox?? I was looking for some build in functions but I found nothing. ...

TabControl's TabItems sharing same content... Do Not Want.

The following example xaml causes each tab item to share the same TextBox. It makes sense, on some level I guess... but it's unexpected behavior, and almost feels like a bug. And I couldn't find any information in the docs explaining the behavior, or how to correctly get around it. <TabControl> <TabControl.Resources> <Style ...

Is there a (good/free) VirtualizingWrapPanel available for WPF?

I've found a couple of alternatives, this CodePlex project and this commercial one, but the former is extremely inefficient in my testing, and the latter, well, costs $$. I've also found this implementation, but it's not so much a WrapPanel as a "TilePanel", and doesn't support automatically-sized items (though it does appear to be fast)...

Insert a Hyperlink at a specified position in a WPF FlowDocument

I'd like to insert a WPF Hyperlink element into a FlowDocument programmatically. The objective is to create a toolbar button that would take a run of text within a RichTextBox and replace it with a Hyperlink. It's the same sort of interface you see on the web for creating hyperlinks on wikis or in blogs (or on StackOverflow). I can fi...

.net wpf textbox capacity

Hi, I have a multi line enabled text box in my application where user can copy paste text . I need to know the capacity of text box - so that I can show a custom text in the text box if user exceeds that limit. ...

WPF Xamlparse error only on other machines

Hi, I recently deployed a Blend WPF application through a clickonce deployment using VS C# express 2010. Now the program works on my development machine but on any other machine the software won't run and a xamlparse error is thrown without any further information as to what has gone wrong. How do I debug these sorts of errors when the...

NavigationWindow - Where is it?

Hey. My WPF application is becoming a real pain. I have created a Window and would like to load another page when I click on a button. I assumed this would be straightforward, but it doesn't seem to be. I manage to load the other page by using this.content = new UserPage(). However, from this UserPage, I can't get back to my main windo...

Does WPF-DataBinding support asynchronous updates

I changed accidentally the value of a BusinessObject-property that implements INotifyPropertyChanged from within a BackgroundWorker (BackgroundWorker.DoWork). Amazingly, this led not to an error but actualized the text of the TextBlock that was bound to the property without any complaint. Is the execution of asynchronous bindings par...

Best Cross Platform Technology for Editing and Viewing Rich Text

I am designing an application that has one requirement of enabling the user to edit and view rich text content. I am not talking about Microsoft Word like editing but more something along the lines of the RichTextControl on Windows or the various Javscript BBCode Editors. The ability to embed images would be an advantage though. The pl...

WPF Layout Performance-Penalty using ColumnSpan

I have a Grid that looks something like the simplified example showed below. There are more elements in the grid but the problem is about the ListBox and the TextBlock. If the TextBlock (or any other element with the same grid-configuration) has a ColumnSpan of two, every Update to an Item of the ListBox is very slow. I have looked with...

Unable to Databind derived property in XAML

I’ve got a property in a base class (view model), which when used in data binding in XAML doesn’t show up. It does however show up when I move that property to the derived view model. Why? XAML: <TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="{Binding Path=ResxMessages.SelectPathToDevice}" /> Code Behind: public abs...

Simple ItemsSource for testing purposes

Can someone show me a system-enumerable that I can access quickly as an ItemsSource to get test-data. I do not care what type it returns. The amount of data is also not very relevant, 100 or 10000 items, I do not care. The desired markup would then look something like the code below and idealy does not need any namespace-declaration: <...

Relate view & viewmodel.

<DataTemplate DataType="{x:Type vm:SalesViewModel}"> <vm:Sales> </DataTemplate> Whats the meaing of the above code in wpf resource file? ...

WPF: Panel with percentage coordinates

Hi, I would like use a panel whose children have coordinates specified as percentage of total panel's width/height. Moreover, I should be able to animate the coordinate property, for example to make a button move from 10% to 50% panel's width. I've made 2 attempts: Use a Grid and specify size as stars - this was not enough, because A...

WPF ShowDialog doesn't display dialog.

I have a WPF application which mostly works just fine. However a couple of people have reported that when they press the browse button nothing happens. The code for this seems pretty simple: private void btnBrowseFile_Click(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.Ope...

How to force a scrollbar to scroll a canvas

Hi I was wondering if there is any way to force a scrollbar to scroll a canvas. I placed canvas in scrollview and I overrode the measureoverride method. Scrollbars show when I reach the ends of visible parts of the canvas. However I would like the canvas to scroll because now, despite the fact that scrollbars show, the canvas does not f...

WPF- ListBoxItem border is sometimes hidden behind the ListBox's scrollbar.

Most of the time the ListBox appears like this: But every once in a while it looks like this: Any idea of what is going wrong? --Edit-- I removed the control templates from the question, because when I removed them from my program the problem still existed. Is this a WPF bug? ...