wpf

where does IValueConverter.Convert source the CultureInfo parameter from?

I'm going through some silverlight apps and reviewing date formatting to make sure the presentation is appropriate for the viewer. with an implementation of IValueConverter, where does the culture parameter come from in the Convert/ConvertBack functions? it seems to not be CultureInfo.CurrentCulture which I think is what I want. ...

How to override default window close operation ?

In WPF I want to change default close behaviour of some window, so that when user clics red close button the window does not close, it merely hides (and call some method as well). How can I do that? ...

build single file application

Hello. I am trying to merge two files. One of them is .net3.5 wpf application and other is WPF notify icon dll i use the following command: IlMerge /target:winexe /out:PS.exe "PlayerSearcher.exe" "Hardcodet.Wpf.TaskbarNotification.dll" But when i launch result assebmly my application is crashed with this error EventType : clr20r3...

Need to know how to create a DelegateCommand<Type> that returns an integer value

Here is what I am trying to do. Pay close attention to the InsertConlogEntry and how I am trying to assign it to my DelegateCommand, but, how do I handle the return int? Thank you, #region Members public static readonly string AddConlogEntry = "AddConlogEntry"; public static readonly string GetConlogList = "GetConlog...

WPF UI Automation - AutomationElement.FindFirst fails when there are lots of elements

We've got some automated UI tests for our WPF app (.NET 4); these test use the UI Automation API's. We call AutomationElement.FindFirst to find a target element, and then interact with it. Example (pseudocode): var nameEquals = new PropertyCondition(AutomationElement.NameProperty, "OurAppWindow"); var appWindow = DesktopWindow.FindFir...

WPF: how to make normal listbox left-drag-select behavior use middle mouse instead?

I'm building a special listbox control that our designers want customized in some tweaky ways. One thing they want to see is that the middle button-drag does what the left button-drag normally does (we are repurposing left-drag to other things). So it needs the two key features that left-drag does in a ListBox default implementation: ...

'EditItem' is not allowed for this view - databinding issue

Hi, I am trying to do data binding in WPF on data grid using a cutom list. My custom list class contains a private data list of type List. I can not expose this list however the indexers are exposed for seeting and getting individual items. My custom class looks like this: public abstract class TestElementList<T> : IEnumerable w...

Alternative to ZAM 3D editor for Windows 7

I'm looking for some 3D editor that allows to create 3D objects and export them to XAML format. Because I'm under Windows Seven ZAM 3D editor is no option for me. I need to create relatively simple(but good looking) 3D objects, no game animations. I prefer simple and intuitive GUI, so Blender is no option for me... It would be good if ...

Enumerate through Grid cell in WPF

hey, I have Grid with 10 rows and 10 column, and I want in code behind get to every of this grid cell to change this background or add image to cell, How can I do it ? ...

Why does this binding doesn't work through XAML but does by code ?

I am trying to bind to a static property on a static class, this property contains settings that are deserialized from a file. It never works with the following XAML : <Window.Resources> <ObjectDataProvider x:Key="wrapper" ObjectType="{x:Type Application:Wrapper}"/> </Window.Resources> <ScrollViewer x:Name="scrollViewer" Scrol...

How to implement IEditableCollectionView interface

Can anyone please tell me how to implement IEditableCollectionView interface? I am trying to use a custom list for data binding to a data grid in WPF (C#) and need to implement this interface for editing data. Thanks. ...

Smooth text animation (Marquee) using WPF

Trying to build a marquee control with smooth text animation. Current efforts include: Using translate transform Using animation on Canvas dependency properties (Left, Right) Using animation on custom dependency property (Point) and using drawing visuals (formattedtext) Using CompositionTarget.Rendering But the animation is still cho...

A custom auto-sizing WPF Panel class

I'm trying to write a custom Panel class for WPF, by overriding MeasureOverride and ArrangeOverride but, while it's mostly working I'm experiencing one strange problem I can't explain. In particular, after I call Arrange on my child items in ArrangeOverride after figuring out what their sizes should be, they aren't sizing to the size I ...

Want to make WPF popup control to be movable( draggable )

Hai am using c#, i created a wpf popup control in my wpf form, when i click the popup is opened, now i want to make that popup as movable one, how u can do this,.... ...

WPF data-bound ComboBox only shows first item of ItemsSource list

Hi all, I'm sure I'm doing something stupid but for the life of me I can't think of right now. I have a ComboBox that is data-bound to a list of Layout objects. The list is initially empty but things are added over time. When the list is updated by the model the first time, this update reflects properly in the ComboBox. However, sub...

Creating a System.Windows.Controls.Image throws an exception - how do I use the dispatcher to instantiate it?

I'm running my unit tests on a piece of code that does the following in the test: Assert.IsNotNull(target.Icon); Inside the getter for the Icon property, I'm doing this: System.Windows.Controls.Image img = new System.Windows.Controls.Image(); That's throwing this exception: System.InvalidOperationException : The calling thread mus...

Using MVVM, how to pass SelectedItems of a XamDataGrid as parameter to the Command raised by the ContextMenu??

Hi, I'm trying to pass the item on XamDataGrid on which I do a mouse right click to open a ContextMenu, which raises a Command in my ViewModel. Somehow the method that the Command calls is not reachable in debug mode. This is the snipped from the view <ig:XamDataGrid DataSource="{Binding DrdResults}" Height="700" Width="600"> ...

Updating the foreground of a label on window active property-WPF

I have a label which shows the name of the window. I want to update the colour of the label on the IsActive property of the window using styles and triggers so that all the labels inheriting this style should exhibit the same property. Please can anyone suggest me how? I tried like this: <Style TargetType="{x:Type Label}" x:Key="Header...

WPF Textbox Preview events related

I have a WPF textbox, and perform the following actions Enter text as "12345" Move cursor between 3 and 4 (using arrow or mouseclick) Enter 0 (so Text is now "123045") Which event/eventargs can tell me that 0 was typed at location 4. I need to know this at Preview level so that I can reject the character 0 based on the prefixed and s...

Enable "Current Page" in PrintDialog

Im using a System.Windows.Controls.PrintDialog to let the user print one or more pages from my application. This is what I currently got: PrintDialog printDialog = new PrintDialog(); printDialog.PageRangeSelection = PageRangeSelection.AllPages; printDialog.UserPageRangeEnabled = true; if (printDialog.Sh...