wpf

When do we use MVVM?

I have been hearing a lot of hype about MVVM for WPF. When do we use it? Is it a use for everything or does it only have specific uses? Is it worth it for every project? ...

How to show a DataTemplate in the window

I have declared a DataTemplate in Window.Resources; I don't intend to use it inside an ItemsControl, but rather just use it as a user control. How do I put it on a form? ...

Dealing with Expression Blend's lack of support for C++/CLI projects

I have a WPF C# project that references a C++/CLI mixed mode project. I'm having trouble using the WPF project in Expression Blend 3. I'm new to Blend so perhaps this is obvious, but it won't display the xaml designer properly until it builds the project. In my case it complains that my custom commands are not "recognized or accessibl...

WPF User Control - Round corners programmatically

Another WPF question... <UserControl x:Class="TKEApp.Components.UserControls.ButtonControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid Background="Black"> <TextBlock Foreground="White" Background="Brown" Name="lblCaption" TextAlignment="C...

Library or own Framework?

When should you use a library or a framework vs your own implementation. For example. MVVM, should I use Cinch/MVVM Framework or roll my own code? ...

Expression Blend 3 Build Configuration

In Visual Studio I can easily control which configuration is built, Debug or Release or something else. How do I control which configuration is built in Expression Blend 3? ...

Choosing between WPF and Silverlight

Hi, We have an existing web application developed using ASP.NET/Ajax We are planning to move it to either WPF or Silverlight. Can someone please compare these 2 technologies with respect to productivity,performance, maintainability,trade-offs, their pros and cons etc ? Also,could I also know the advantages/disadvantages of using Silve...

Richtext Box formating help in WPF using c#.net

i am making a project for bulk emailing . In this I have added a richtext box . I want users to enter the email message body in it and want to give them the ability to format .Richtext box should be able to make the content bold,italics, underline , align it right left and center , increase font , decrease font,change color, change the f...

How can I use Window.ShowActivated = false with Maximized window?

I have an application that has a splash screen shown before I create my main window. I want to avoid the main window stealing the focus when it gets created if the user has focused another application while the splash screen was shown. My application's startup looks like this: private void Application_Startup(object sender, StartupEven...

Wpf tool kit datagrid DataGridCheckBoxColumn on_click event:

I want to get the selected rows, but selecteditems has only one row. I want get the all the checked item. I think I need to add event handler when the checkbox is clecked and then collect them all. How do I do this in a best way? ...

Expression Blend doesn't recognize command objects declared in code behind file

I have a WPF UserControl. The code behind file declares some RoutedUICommand objects which are referenced in the XAML. The application builds and runs just fine. However Expression Blend 3 cannot load the XAML in the designer and gives errors like this one: The member "ResetCameraCommand" is not recognized or accessible. The c...

Horrible WPF performance!

Why am i using over 80% CPU when just hovering some links? As you can see in the video i uploaded: http://www.youtube.com/watch?v=3ALF9NquTRE the CPU goes to >80% CPU when i move my mouse over the links. My style for the items are as follows <Style x:Key="LinkStyle" TargetType="{x:Type Hyperlink}"> <Style.Triggers> ...

How to find out minimal render size of a visual in WPF?

Hello, I'm trying to display a game desk and info panel right next to the game desk and I need to calculate minimal width of the info panel in order to display the game desk properly. This is my XAML code: <StackPanel Orientation="Horizontal"> <Rectangle Width="Auto" Height="Auto" Name="gamedeskRect" Style="{DynamicResource GameDe...

.NET make a copy of an embedded file resource to the local drive

Hi, i'm new to the realm to working with Files in .NET I'm creating a WPF application in VB.NET with the 3.5 Framework. (If you provide an example in C#, that's perfectly fine.) In my project I have a Template for an MS Access database. My desired behavior is that when the users clicks File-->New, they can create a new copy of this t...

WPF Focus In Tab Control Content When New Tab is Created

I've done a lot of searching on SO and google around this problem, but can't seem to find anything else to try. I have a MainView (window) that contains a tab control. The tab control binds to an ObservableCollection of ChildViews (user controls). The MainView's ViewModel has a method that allows adding to the collection of ChildViews, ...

Call bindings for DependencyObject when DependencyProperites are changed

Is there a way to notify a DependencyObject's bindinigs when the inner DependencyProperties have changed? For example, I have this class: public class BackgroundDef : DependencyObject { public static readonly DependencyProperty Color1Property = DependencyProperty.Register("Color1", typeof(Color), ...

WPF - Sample App, Step by Step

I'm new to WPF development. Is anyone aware of a site or resource that builds a somewhat simple WPF application step by step, with ample explanation and/or documentation? ...

Can I set the base path outside of my application directory when binding an image source path to a relative path in WPF?

So I'm trying to display an image that is ouside the path of my application. I only have a relative image path such as "images/background.png" but my images are somewhere else, I might want to choose that base location at runtime so that the binding maps to the proper folder. Such as "e:\data\images\background.png" or "e:\data\theme\im...

Regular Expression Help in .NET

I have a simple pattern I am trying to match, any characters captured between parenthesis at the end of an HTML paragraph. I am running into trouble any time there is additional parentheticals in that paragraph: i.e. If the input string is "..... (321)</p>" i want to get the value (321) However, if the paragraph has this text: "......

Why isn't TextBox.Text in WPF animatable?

Ok, I have just run into something that is really catching me off-guard. I was helping a fellow developer with a couple of unrelated questions and in his project he was animating text into some TextBlock(s). So, I went back to my desk and recreated the project (in order to answer his questions), but I accidentally used TextBox instead o...