wpf

Silverlight button style

I am trying out new styles with silverlight, and I created a new button skin with blend that consists of a border and a textblock. Wondered if there is a way to change the the text of the textblock when the the button's content(text) property is changed. ...

In WPF, can you bind a ListView (NOT DataGrid) to a Matrix (Cross-Tab) DataSet?

Is it possible in WPF to bind a ListView (NOT a DataGrid) to a Matrix (Cross-Tab) DataSet in which the columns are unknown beforehand? Using the Northwind database as an example: the simple query below will return a wellknown dataset which can easily be bound to a listview: SELECT Year(o.OrderDate) AS [Year], Month(o.OrderDate) AS [Mo...

WPF - enumerate child elements of a ListBoxItem

The actual visuals are dictated by a DataTemplate. In runtime, how can I iterate through all the visual elements of a ListBoxItem? ...

Silverlight Project -Expression Blend

Is there a way to apply bitmapeffects within a silverlight web project. ...

WPF Stability in VS2008 Express

I'm having trouble with stability in the xaml editor. Restart VS 25 times a day has become tedious. Are there strategies that would minimize the problem or an open source alternative that provides a visual display? Any help would be sincerely appreciated! I don't want to jump out the window but I will... I WILL! ...

Backgroundworker won't report progress

I have a background worker running a long database task. i want to show the progress bar while the task is running. Somehow the background worker won't report the progress of the task. This is what i have: BackgroundWorker _bgwLoadClients; _bgwLoadClients = new BackgroundWorker(); _bgwLoadClients.WorkerReportsProgress = true; _bgw...

How do I build a paged ItemsControl or Panel with a repeating header?

I'm trying to build a Panel or ItemsControl that will display items in the form of: Header 1 Sub Item 1 Sub item 2 Sub Item 3 Header 2 Sub Item 1 Sub item 2 This is easy enough, but the catch here is that I need to be able to split the items in a Paged fashion. Based on the height of the control, whatever does not fit will be o...

How to merge menu with WPF MVVM?

The default MVVP I have seen has multiple ViewModel objects that are rendered through data templates. Each ViewModel exposes commands via their own properties. I would like to merge ViewModel commands with the menu so when different tabs are selected, the menu changes based on what the ViewModel does. What would be the best way to do ...

Importing WMF (Windows Metafile) or any other vector file into a silverlight project

Is it possible to import WMF (Windows Metafile) or any other vector based file into a silverlight project? ...

How do you convert a System.Windows.Input.KeyEventArgs key to a char?

I need to get the event args as a char, but when I try casting the Key enum I get completely different letters and symbols than what was passed in. How do you properly convert the Key to a char? This is what I've tried ObserveKeyStroke(this, new ObervableKeyStrokeEvent((char)((KeyEventArgs)e.StagingItem.Input).Key)); Edit: I also do...

How to cancel a routed event?

I have a WPF application, where when a user unchecks a checkbox, the application will prompt to confirm. If the user chooses not to continue (cancel) is selected, i want to cancel the uncheck event. In another word, i want the checkbox to remain checked. How can i do that in WPF? Thanks in advance. ...

WPF: How to make canvas auto-resize?

I would like my canvas to automatically resize to the size of its items, so that the ScrollViewer scroll bars have the correct range. Can this be done in XAML? <ScrollViewer HorizontalScrollBarVisibility="Auto" x:Name="_scrollViewer"> <Grid x:Name ="_canvasGrid" Background="Yellow"> <Canvas x:Name="_canvas" HorizontalAlignme...

WPF - access to resources in design time when App.xaml's Build Action = Page

I changed the build action of my App.xaml to "Page" so I could handle a splash screen and make sure my application run as a single instance only (having my own entry point). It works fine in run-time but in design-time the application cannot see the my resources anymore. Resources are in separate xaml files located in the same project. H...

WPF ListBox Selection Problem when changing an item

When changing the selected item in a ListBox, I'm getting a weird error where the changed item appears selected but I cannot deselect it or reselect it. Is there a way to fix this? Here's a sample app that demonstrates the problem. public partial class Window1 : Window { public Window1() { InitializeComponent(); ...

.NET WPF Process.Start() not working on Vista and Windows 2007

Hello, I have WPF application. After testing my app on Windows7 and realized that opening help does not work. Basically to open chm help file I call: Process.Start("help.chm"); And nothing happens. I have also tried my app on Vista SP1, same result. I'm admin in both OS'es I have googled this problem, but have not found solution ...

Not allow zero in textbox.

I need a textbox which only the user can permit to enter integers. But the user can't enter zero. i.e, he can enter 10,100 etc. Not 0 alone. How can I make event in KeyDown? ...

WPF Expander Collapse

This is more of annyoing than a real problem but I like to understand why. A Expander Control in a WPF (.net 3.5sp1) created with Expression Blend 2. If in code behind void talk_On() { Ui.Dispatcher.Invoke(new Action( delegate() { this.expander.IsExpanded = false; })); } ...

WPF Basics: How to set an outside property in a DataTrigger?

Hi, I"m trying to get my head wrapped around the WPF model. I have a list box of items. Inside the list box items are string identifiers. This works fine. What I want is to have it so that the identifier from the currently selected item is accessible in my code-behind for the enclosing control. I have this: <ListBox.ItemTemplate> <D...

Set Monitor DPI in WPF

On my PC the default DPI is 96dpi, but I want my WPF application to be scaled on 120dpi, is there any way to do that ??? PS: I don't want to change PC settings ...

Change value in setter property when using WPF two-way databinding

I have a TextBox that is bound to a Text-property on an Entity-object. I'd like to be able to re-format the text the user enters in some circumstances - e.g. if the user enters "2/4" (a fraction) - I'd like to change that to "1/2". Via the “set-part” of the Text-property, I can change the value on the Entity-object, but that doesn't app...