wpf

WPF not applying default styles defined in MergedDictionaries?

In a WPF application I defined default control styles in separate resource dictionaries (e.g. "ButtonStyle.xaml"), and added them as merged dictionaries to a resource dictionary named "ResDictionary.xaml". If I refer this "ResDictionary.xaml" as merged dictionary in my App.xaml, the default styles are not applied. However, if I refer th...

Using WPF controls in a background or ASP.Net environment

Hi, I have noticed that some WPF controls have some decent effects available to them (drop shadow, reflection etc), and was wondering if it was possible to use these WPF controls solely for their available effects? For example, I have an image manipulation library that resizes and letterboxes disparate sized images but I would like to ...

InPlaceBitmapMetadataWriter.TrySave() returns true but does nothing

On some .JPG files (EPS previews, generated by Adobe Illustrator) in Windows 7 InPlaceBitmapMetadataWriter.TrySave() returns true after some SetQuery() calls, but does nothing. Code sample: BitmapDecoder decoder; BitmapFrame frame; BitmapMetadata metadata; InPlaceBitmapMetadataWriter writer; decoder = BitmapDecoder.Create(s, BitmapCrea...

UserControl as ListBoxItem and IsSelected

I have a usercontrol that I want to use as a ListBoxItem. <ListBox.ItemTemplate> <DataTemplate> <local:MyUserControl/> </DataTemplate> </ListBox.ItemTemplate> I'd like to play a storyboard when the usercontrol is unselected. <UserControl.Resources> <Style TargetType="{x:Type UserControl}"> <Style....

Draw a column graph with no space between columns

I am using the WPF toolkit, and am trying to render a graph that looks like a histogram. In particular, I want each column to be right up against each other column. There should be no gaps between columns. There are a number of components that you apply when creating a column graph. (See example XAML below). Does anybody know if there i...

WPF TreeViewItem deselected item still lightly highlighted

Hello WPF fellows, I have multiple expander controls with a ViewTree control within each expander control. When I select a ViewTreeItem from one ViewTree and then select another ViewTreeItem from another ViewTree, the newly selected ViewTreeItem is highlighted in dark blue, but the last selected item is now highlighted in a very light s...

wpf app invisible remotely (via radmin)

hi gang, I've built a little WPF utility that watches a serialport and visualises monitoring information with WPF. It works fine, but a colleague just tried using it from another machine via radmin and my app is completely invisible! if you're at the machine you see it, if you view it via radmin you see the same screen but no app. Inste...

WPF Validation on two properties

I have a user control that contains a border somewhere in it. I am able to edit both the User Control Width and the Border Width from binding to two textboxes. I need to include validation when I create the binding in code so that the Border Width can't be higher than the User Control Width. ...

Free Calendar/Schedular Control in WPF

Is there any free WPF calendar/Schedular /appointment control available , I have searched on google but couldn't find one. ...

WPF TextBox trigger to clear Text

Hi ! I have many TextBox controls and I'm trying to write a style that clears the Text property when the Control is disabled. I don't want to have Event Handlers in code behind. I wrote this: <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> ...

How to remove the shadow from a librarystack

I'm currently in a project where I need a LibraryStack with no visuals at all, so it would just show the content. If I just remove the background a shadow stays in view which I cant seem to remove... This code looks like: <s:LibraryStack Background="Transparent"> <s:LibraryStackItem Background="AliceBlue"/> <s:LibraryStackIte...

Binding to element in WPF: can the Path expression do math?

Hi I'm trying to bind a control to the parent's Height/width property using ElementName and a Path. However, I don't want to bind to the actual height, but to exactly half the height. Can the Path expression do the math? e.g. Path={ActualHeight/2} I couldn't find a way to do that. IS there any other clever approach? Thanks! ...

WPF: Change the style of a ViewBox depending upon the amount of data

Hi there, I have a WPF app that has a ViewBox to display the items in my collection, diplaying a 2-column grid for my results. What I'd like to do is, depending on the number of items in my collection, change the number of columns. E.g if there are < 10 items in the list, then show them in just 1 column; If there are 10 items in my li...

Access WPF user control value

I have 2 text box in WPF user control and button on WPF form. How can I access those textbox value on the button click event of that main form where I am using the WPF user control ...

Calling WPF Control Library

Hi all, When I want to show user a (windows) form which resides in a DLL (in this case Form1), I use the following code from another executable; Assembly a = Assembly.Load(System.IO.File.ReadAllBytes("mydll.dll")); Form MyDLLFormInstance = (Form)a.CreateInstance("myNamespace.Form1"); MyDLLFormInstance.Show(); Now, I created another D...

what needs to be done handle dialog windows in MVVM

what all necessary steps to be done to handle dialog windows in MVVM. ...

WPF ListBox's scrollviewer customizable so that there is no Scrollbar, only RepeatButtons

Hi I would like to customize the scrollbars of a listbox's scrollviewer in such a way that the scrollbar only consists of a RepeatButton for scrolling up and a Repeatbutton for scrolling down. Nothing else. There should be no scrollbar (track) between the buttons. One button should be to the left of the ItemsPanel (scroll up) and the oth...

Add a click event to a listbox filled with objects in code

Hey guys, I'm trying to sho a contextmenu on right-click on an item in a listbox. So i'm binding a list of "Users" to my listbox. Then i'm a bit lost. I thought i could foreach the list and add a mouserightdown event on the listboxitems, but i can't figure out how. Is this a good way, or does anyone know a better way of accomplishing w...

WPF vs XNA to render thousands of sprites

Hello, I need to render thousand of ellipses linked each others with lines. What would be the best way (in terms of performances) to render it inside a WPF application. Is WPF Canvas painting a lot worse than XNA painting ? Actually, the hidden question is : is it possible to do some xna-rendering inside a WPF host ? I saw some example...

WPF: Making things appear above expanded combobox

Is there any way to make something appear above the popup part of a combobox? Panel.ZIndex doesn't seem to help - the popup part is always displayed above everything else! As an example, if you use the following code, is there any way to make the textblock appear above the popup part of the combobox when it is expanded? <Window x:Clas...