wpf

Visual studio 2010 WPF

Hello.. I can add the Chart control located in Data group of toolbox if i create a windows form application..but if i create a wpf application i cant! it is disabled.. what can i do? ...

Symbols, Special character display issue in wpf.

In WPF text block, I want to display special characters like diamond (♦) etc. It is displaying fine in some systems and in some systems, it is displaying a plain box instead of the symbol. Can somebody help me to resolve this issue. Thanks in Advance. -Elangovan. ...

Best Practice WPF Prism Resources

I have a a WPF prism desktop app with a few modules. In the past I've put all my localized resources in common resource files in the infrastructure assembly and referenced it in all modules. But lately I have been wondering if that is indeed the right approach from a maintainence perspective. In essence it also sort of breaks modularit...

How to define condition variable on xaml ?

I define some style on some button. The style supposed to change the button bitmap in 'mouse over'. The problem is that there are two scenario with two different bitmap => that mean Scenario 1: the original bitmap is B1 and in 'mouse over' it need to be change to B2 Scenario 2: the original bitmap is C1 and in 'mouse over' i...

WPF checkbox programmatically remove event

Hi there, Does anyone know how to programmatically remove/add the checked and unchecked event on WPF checkbox? ...

Multi threading in wpf using c# (with background worker)

Hi, I have written a code to save the image which is generated by the application. The size of image is around 32-35 MB. While saving the image to a bmb file, it is taking long time around 3-5 secs. For the purpose, I have used background worker but when running background worker, it shows an error like..."cant access the object as it i...

Sharing a common DAL between WPF, Silverlight, and ASP.NET

What is the best method/technology to sharing the same data access layer between WPF, Silverlight, and ASP.NET? I am using ADO.NET Entity framework, and was thinking of a creating a DAL using the Repository pattern.Then using the RIA Services as a dummy middle man to connect Silverlight and ASP.NET. Is this a solid plan or are there ot...

How to get data using ListView Binding via MVVM in wpf ?

i try to use generate MVVM pattern using Silverlight ListView. But if i bind data my silverlight control no data visualize. also no error return. i see empty gridview. Model: MyData.cs public class MyData { public int ID { get; set; } public string Name { get; set; } public string Price { get; set; } ...

How to customize the UI display of a list item?

I want to add a prefix and surfix gradient panel to decorate the items in a list. I'm new to custom control and need a started point to do this. Please show me how to do it. ...

C#/WPF: Drag & Drop Images

I want to allow dropping of image files in my application: Users can Drag images from Windows and Drop them into my Window. I have the following code but it seems its not working. I tried both FileDrop & Bitmap, both fails private void Border_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)...

Crash on debugging unit test via NUnit

Hi. Debugging unit tests with the NUnit 2.5.3 framework causes a crash on my machine. var app = new Application(); throws an exception System.EntryPointNotFoundException occurred Message=Unable to find an entry point named 'nonexistent_dummy' in DLL 'MSVCR80.dll'. Source=PresentationCore TypeName="" StackTrace: at non...

C#/WPF: Event hander triggered only when over child element

I have attached Event Handlers to a Border but it seems they only work when i drag over a child TextBlock <Border BorderThickness="5" CornerRadius="20" Margin="15" BorderBrush="Black" AllowDrop="True" DragEnter="Border_DragEnter" Drop="Border_Drop"> <TextBlock Text="Drop images here" HorizontalAlignment="Center" VerticalAlignment="C...

ViewModel breaks UI automation in WPF

Hi, I have a WPF application that mostly follows MVVM, which I am trying to automate. In some of my user controls I bind the Content property to the ViewModel of another user control. There is a data template defined which maps the ViewModel to the correct View to show on the screen. This works fine for when the application is run b...

WPF ValidationRule with dependency property

Suppose you have a class inheriting from ValidationRule: public class MyValidationRule : ValidationRule { public string ValidationType { get; set; } public override ValidationResult Validate(object value, CultureInfo cultureInfo) {} } in XAML you are validating like this: <ComboBox.SelectedItem> <Binding Path="MyPath...

WPF Validation: Is there a way to add multiple errors to a field?

I use Validation.MarkInvalid to set errors to field. Is there any way I can set more than one error for a field? (I'll then use the converter described here to show them) MarkInvalid seems to be ignored if an error is aready set for a field. ...

Binding wpf textblock to static class property

Hi, I want to bind a textblock text to a property of a static class. Whenever the property value of the static class changes, it should reflect to the textblock which is on the other window or custom control. Thanks ...

WPF - Binding StringFormatting Not Working

Hi, I need to append a simple string to my commandparameter but doesnt work. Does StringFormat support this or am I doing anything wrong ? <DataTemplate x:Key="ClickableHeaderTemplate"> <Button x:Name="btn" Content="{Binding}" Background="Transparent" Command="{Binding DrilldownHeaderClicked}" ...

WPF RightClick MouseBinding on release?

How can I enable a mouse binding to the release of the right button? At the moment I have the following code in xaml which is linked to closing the wpf window. The problem here is that because it reacts to the rampup of the click when closing the window it activates a context menu on the desktop. <MouseBinding Command="Close" MouseActio...

FindAncestor does not work for UserControl in ListView.ItemTemplate

Hi Everyone, I'm having some issues when trying to bind a property of a UserControl in a ItemTemplate with a FindAncestor mode. I have the following code: <Window x:Class="TestUserControlBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200...

Vertical alignment of WPF Checkbox content with respect to checkbox

I have a checkbox whose XAML markup is as follows: <CheckBox HorizontalContentAlignment="Stretch"> <StackPanel Orientation="Vertical"> <TextBox x:Name="editTextBox" Text="{Binding Path=Caption, Mode=TwoWay}" TextWrapping="Wrap" Visibility="{Binding Path=IsBeingEdited, Converter={StaticRes...