wpf

How do I convert System.Windows.Media.SolidcolorBrush to System.Drawing.Color ?

I need to convert a System.Windows.Media.SolidcolorBrush to a System.Drawing.Color in C# any clues would be great. ...

Fade out effect for WPF DataGrid´s DetailsView doesn´t work

Hi all I created a fade in / fade out effect for the WPF DataGrid´s DetailsView animating the DetailsView´s Opacity and Height properties. The fade in effect works nice but the fade out effect just produces a hard collapse of the DetailsView. The animations are called in the DataGrid´s RowDetailsVisibilityChanged event handler - I thin...

WinForms to WPF - How do we get there from here?

Is there a practical way for us to slowly evolve a WinForms application to WPF without creating a support nightmare for ourselves with strange interop scenarios? Background info: We have a large battleship gray WinForms application that is heavily used by an internal group of about 60-75 users. We're starting to run into places where ...

How to convert items from itemssource

Hi, how can I convert a single Item from an Itemssource to another Item? For example, I have a collection of TypeA which is not directly tied to a TypeB, but I need to Access TypeB in the ItemTemplate. <DataGrid ItemsSource={Binding SomeCollectionOfTypeAWhichCanBeConvertedByAlgorithm}> <DataGridTextColumn Binding="{Path=PropertyOfT...

CollectionType Dependency Property

Hi Based on this tutorial: http://www.dotnetfunda.com/articles/article961-wpf-tutorial--dependency-property-.aspx I've created my usercontrol like this: usercontrol xaml: <UserControl x:Class="PLVS.Modules.Partner.Views.TestControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sche...

Zune theme for WPF

Hi, I would like to know where i can get the theme that looks like Zune application for Windows (or MetroTwit) for WPF. I google it but i only get the theme for Silverlight 4, not WPF. ...

WPF: Dependency Properties and DataContext

I was working on creating a reusable custom control (not a user control) in WPF. I created the XAML in the Themes/Generic.xaml file and I setup the "lookless" functionality in the control's CS file: AddressField.cs using ...; namespace MyNamespace { [TemplatePart(Name = AddressField.ElementAddress1TextBox, Type = typeof(TextBox...

XAML test data - designer can convert types but runtime cannot

I am designing a user control to display a note. So I have a NoteViewModel. In my designer I want to have a test note. So I have the following in my XAML: <UserControl.Resources> <local:NoteViewModel x:Key="ViewModel" d:IsDataSource="True"> <local:NoteViewModel.Note> <localweb:Note NoteID="1" ...

Can I prevent maximising of a window in WPF?

Specifically, not just by removing the buttons but completely disable maximising. This would mean that double-clicking the title bar or dragging the title bar to the top of the screen in Windows 7 would not work. I still want the window to be sizable though. ...

SilverLight / WPF Button with DropDown

Is it possible to create a button with a drop down, or a combobox that has the dropdown arrow along the bottom as opposed to the right hand side? I am trying to emulate the "Paste" button in the Word 2010 ribbon. ...

WPF DevExpress DockLayoutManager Layout Issue

I am using DevExpress' DockLayoutManager in a UserControl. Within the DockLayoutManager, I use LayoutGroup, and within LayoutGroup, I have two LayoutPanels. The two LayoutPanels are stacked vartically. I want the second LayoutPanel to be a fixed height, docked at the bottom left of the UserControl, and I want the first LayoutPanel to ...

C# BeginInvoke problem

Why does i have this error and how to fix it. Thanks for help Error 4 Cannot convert lambda expression to type 'System.Delegate' because it is not a delegate type void provider_GetAssignmentsComplete(object sender, QP_Truck_Model.Providers.GetAssignmentsEventArgs e) { lvMyAssignments.Dispatcher.BeginInvoke(() => ...

First Time Calling Extension Methods is Slower Than Subsequent Calls

Hello, I have a class that modifies data via some extension methods. In order to debug performance, I have created some rough debug code to make multiple calls to the same methods using the same data a number of times. I am finding that it consistently takes a significantly longer time to do the calculations the first time through the...

VB.NET using LINQ to transpose an ObservableCollection

I have a custom item class (basically two string values with associated properties), as below: Public Class itmDataDetails Private _strDataName As String Private _strDataValue As String Public Property strDataName() As String Get Return _strDataName End Get Set(ByVal value As String) ...

How can I bind to dependency properties of a custom control from a resource dictionary defined in Generic.xaml?

EDIT: I rephrased the entire question. Hello everybody, I have a custom control with dependency properties. In the Generic.xaml file I have a resource dictionary. It's a resource dictionary within the outer dictionary, defined like so: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http...

WPF, updating status bar in main window from within UserControl

I have a StatusBar in my main window, and I also have a copy of a UserControl in my main window. From within event handlers in my UserControl, I want to update the StatusBar in the main window. What would be the best way of doing this? Is there a way of getting access to the instance of my main window from object sender or RoutedEvent...

Entity Framework - how to raise OnChanging for any property?

In a WPF / EF4.0 / MVVM app I have a View that edits a Customer entity. What is the best way to set a property "bool IsCustomerInEditMode" in my CustomerViewModel short of acting upon OnChanging/OnChanged partial methods for every single individual property of the Entity? As far as I know there's no OnEntityChanging method... Thanks! E...

WPF, share methods between two UserControl classes

I have two UserControl classes, RequiredFields and OptionalFields. I wanted to have a base class, Fields, that would inherit from UserControl and contain methods that both RequiredFields and OptionalFields would use. However, when I try to do that, I get the following error: Partial declarations of 'MyNamespace.OptionalFields' must...

WPF & MVVM : best architecture for Time-consuming search results ?

I am designing the architecture for a module where a search takes place. the search takes some time, and I would like to have the UI to be responsive, so I get to delegate the retrieval of the data to a class that will do the search on a separate thread. Then, I can think of two options : either 1° : the search method returns a view...

wpf transparency

I am using a ListBox with a DataTemplate to create the below map legend. I would like to get the ListBox to have a transparent background (where it is now white) and the ListItems to retain their existing white background. The two legends would then appear to float with a transparent gap between. I have tried setting the ListBox backgro...