wpf

WPF RichTextBox - Replace Selected Text with Custom Control

Before I start hacking in a really crude solution, I thought I'd see if someone could give me a little nudge in the right direction. What I really want to do is let a user select some text in a RichTextBox, click a button, and convert that text into a custom rendered control. Convert it to a Button containing the text they had selected...

WPF DataContext for Child/Detail UserControl/View

I am new to C# and WPF, so please bear with me.. This isn't exactly a Master/Detail scenario, and could be why I am having problems, but generally, I am trying to figure out how to relate two sets of data that are not quite master/detail. To keep it simple, let's say I have two view/viewmodels for 1) Person ID, FirstName, LastName 2...

Set font properties in RichTextBox

HI, I am developing an editor using RichTextBox in WPF, i have to implement feature that user can set font of selected Text if some text is selected, if nothing is selected then font should be set for new text. If i set the font properties(like FontStyle,FontSize) of RTB in later case it will set the properties for whole text, How can i...

Vista style window Close button in XP

How can I create a a custom button that looks and feels like Vista close button? Can any one have a template? ...

Any free animation available for WPF?

Being developer its very hard to designing and Animate the thing... Are there any animation libraries (like WPF themes) available out there for WPF ?? ...

How to change DPI of part of a WPF/Silverlight application?

I want my application to have a zoomable element which will allow the XAML elements to be viewed at 25%, 50%, 100%, 200% etc, I just need to alter the DPI of the XAML but am unsure how to do this on just part of the XAML (i.e. the element to zoom). It will work just like the designer view in Visual Studio when you can zoom into the contr...

Differnce between Control Template and DataTemplate in WPF

What is difference between ControlTemplate and DataTemplate in wpf. ...

WPF - How to force a Command to re-evaluate 'CanExecute' via its CommandBindings

I have a Menu where each MenuItem in the hierarchy has its Command property set to a RoutedCommand I've defined. The associated CommandBinding provides a callback for the evaluation of CanExecute which controls the enabled state of each MenuItem. This almost works. The menu items initially come up with the correct enabled and disabled...

WPF: hiding a tab item in a tab control thats bound to an observable collection

Heya I have a tab control bound to an observablecollection for dynamic tabs as follows: <TabControl ItemsSource="{Binding AllTabs}" SelectedIndex="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <TabControl.ItemTemplate> <DataTemplate> <!--.............. --> ...

WPF Replace value in TextBlock

Lets say i have a TextBlock thats bound to a DateTime, is there any way to replace the value 0001-01-01 00:00:00 with an empty string? ...

Cannot find the Trigger target 'stateBrush'

What is wrong with the following ControlTemplate why can't it find the named Brush? I alway get the error Cannot find the Trigger target 'stateBrush'. In my template I would start to animate the background when the state changes to WaitForActive and I want to set it to green when the state changes to Active. Pretty simple. Is my approach...

WPF 3D algorithm question: what model does it use?

Please refer to Wiki definitions about 3d modeling, what modeling algorithm WPF 3d use? Polygon or NURBS? Thanks Mike ...

Collection instance with ContentProperty on XAML errors out

Hi I have a observable collection as follows.... I used to get designer ignorable error as "type(0) does not support direct content" due to which I implemented ContentProperty as shown below... but now I get two unavoidable errors at the designer as 1.The object 'CustomDataGridColumnCollection' already has a child and cannot add 'Da...

Advice needed for multi-threading strategy for WPF application

Hi I'm building a single window WPF application In the window is a list items (which are persisted in a database of course) Periodically I need to start a background task that updates the database from an Atom feed. As each new item is added to the database, the list in the UI must also update to reflect this. I don't want this backgrou...

WPF ComboBox not responding to mouse

I have a very weird problem with a WPF ComboBox. On one computer (and only one) in our company the WPF ComboBox refuses to respond to mouse events when the ComboBox drop down is open. When the user clicks on the ComboBox to make the drop down appear and tries to select an item, he/she gets no hover effects from mouse over. When the user ...

Access to all controls from a WPF windows

Hi, I implemented a fonction in Visual Basic 2008 that takes the content of all the controls from a System.Winows.Form object and return a hash value corresponding to this content. The use of this function is to detect whether or not the user modified the content of the page and determine if I have to display a message box asking to sav...

Point at a given Run flow document wpf

Hi, I've got a FlowDocumentPageViewer with dynamic content. The flow document is made of paragraphs, each run in the paragraph contains a word. I'm trying to navigate to a given run, so I got the method which will return me the run I want. But once I got this Run how can I navigate to it, with automatic page change? For example I sele...

WPF - Handling custom attached events on custom controls

I have a routed event declared as such (names have been changed to protect the innocent): public class DragHelper : DependencyObject { public static readonly RoutedEvent DragCompleteEvent = EventManager.RegisterRoutedEvent( "DragComplete", RoutingStrategy.Bubble, typeof(DragRoutedEventHandler), typeof...

Which Design Pattern to use for MS Surface Apps (WPF)?

Background: I'm currently for my University creating some simple apps showcasing the possible educational potential of the Microsoft Surface. Their functionality falls somewhere between a basic demo app and a full-fledged production app. Our hesitation with using MVVM or some other type of MVC is that, with the exception for the few a...

ItemsPanelTemplate of a ListView throws apperently worngly an exception

Hello, I created a user control which contains a ListView with a custom ItemsPanelTemplate. <UserControl x:Class="..." xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="thisUserControl"> <ListView ItemsSource="{Binding Source={StaticResource cvs}}" N...