wpf

WPF 4 - DatePicker - How to set DisplayMode to Decade?

This code makes the background of the calendar orange, but it does not default the DisplayMode to Decade. Does anybody know why? What can I do to default it to "Decade"? <DatePicker SelectedDate="{Binding TheDate}"> <DatePicker.CalendarStyle> <Style TargetType="Calendar"> <Setter Property="DisplayMode" Value="Dec...

Styling my WPF application like LightSwitch?

Hello! The LightSwitch look beautiful to me, and I'd like to implement these themes to my WPF apps as well. Is there a way I can mimic the LightSwitch themes to my app? ...

Sort listbox by dragging items: Xaml Fluidlayout or codebehind?

Hi, I'm looking into ways of resorting a listbox by dragging the items in it to a different place in the list. I've looked into the new fluidlayout technology and though it looks very useful, there is also very little documentation. Has anybody got experiences with this, and also: can the sorting by dragging the items be achieved by mo...

How can i bind a list of my custom class(Ex :Student) objects to a list view in WPF

How can i bind a list of my custom class(Ex :Student) objects to a list view in WPF ? My XAML markup for :ListView is here.I want to show the users in the Listview like a html table ListView Height="100" HorizontalAlignment="Left" Margin="27,98,0,0" Name="listView1" VerticalAlignment="Top" Width="320"> <ListView.View> ...

WPF - Global Style?

Hey all, Is there a way to setup global styles for my WPF application? What I'm hoping to do is apply a style to all my Buttons that also have an Image child. Thanks in advance, Sonny ...

WPF: Use a different template depending on size and number of items

Hello, I'm trying to work out how I can alter the template depending on the size and number of items. This is very similar to the ribbon which dynamically changes depending on the size, or Windows 7 thumbnail of programs. In this case, it's an ItemTemplate of a ListBox and I want to reduce the size of the image or not display it, rathe...

WPF, update TextBlock when CheckBox checked

I have a TreeView where each item has a checkbox. I want a TextBlock to be updated whenever an item is checked or unchecked in the TreeView. The TextBlock's Text should be bound to the CheckedVersions property on my DataContext so that when I read the CheckedVersions property, it gives me a string representing all the checked items in ...

Expression Blend 4.0 - What layer effects and blend modes are supported for imported Photoshop files?

Many Photoshop effects aren't property supported by Expression Blend. Usually I see an option to "flatten layer" to get around this problem. Is there a comprehensive list of what effects or blend modes are supported by Blend? I'm curious about the Silverlight features supported during import but would also like to know if there are an...

How can I forward mouse events to a different element

How can I have have one element forward the mouse events to another element? I would like to simulate a margin that forwards events to the content. In the following example, r1 is the margin and r2 is the content. <DockPanel> <Rectangle DockPanel.Dock='Left' Name="r1" MouseLeftButtonDown="r1Down"/> <Rectangle Name="r2" MouseLeftButton=...

How to make Silverlight UserControl fill webpage?

I am building a webapp in Silverlight 4.0 and I would like it to have it expand to fill the width and height of the web browser. However, I can only get it to remain top center at the moment. I have a Grid with 3 rows, 2 columns and Controls inside these which fill the cells. Therefore I only believe that I need the Grid to stretch to t...

DataGrid Sorting retention on ItemsSource Changed

Hi All, I am using an MVVM approach. I have a ViewModel and View called AllSomethingViewModel and AllSomethingView. The View Model contains a list of SomethingViewModels and a SelectedViewModel. The View contains a usercontol bound to the AllSomethingViewModel's SelectedVM property and a listbox control that lets me select a VM. Basica...

Calling ActionScript (Flash) method via mshtml from C#

Hi, I use the WebBrowser component from WPF. I load there a page from Internet and I access the Document property to call my scripts. Unfortunately calling scripts don't work as I need. When I am calling JavaScript methods which exist in JavaScript so it works great but when I need access some methods which are available through Flash s...

WPF - Correct way to commit changes when using ObservableCollection and linq-2-sql

If all of my wpf controls bind to ObservableCollections and I am using linq-2-sql to populate these collections, what is the correct way to commit changes whenever properties of these objects are updated? Currently I am calling DataClassesDataContext.SubmitChanges() manually, which is a bit tedious. Is there a way to do this automatical...

WPF MediaElement not entering "Element_MediaOpened" half of the time.

Hello.. I have an interesting question. Would there ever be a reason why when I set the source of a media element, then call it to play, that it would play some time, and other times it wouldn't? I noticed every time it does play, it hits my Element_MediaOpened function. Why could this be happening? Is this a bug? ps: opening is set t...

Does VisualStateManager.GoToState return when the animation completes?

As the title mentions, does VisualStateManager.GoToState return once the state transition completes if I specify UseAnimation = true? Or does it return instantly and the animation runs later? ...

WPF: Srollviewer not working in Items control.

I have a itemscontrol under scrollviewer. and under this items control I have another Usercontrol with items control under scroll viewer. something like this: scrollviewer itemscontrol .... /itemscontrol /scrollviewer under the above itemscontrol there is a usercontrol having: scrollviewer itemscontrol .... /itemscontrol /scrollviewer...

autocompletebox focus in wpf

when I try to focus on my "autocompletetextbox" I failed I write autocompletetextbox.focus() but the cursor still focus in another what should I do or write to enable to write in it or focus? ...

Binding Date of DateTime in a control

Text="{Binding Path=PostDate.Date}" I don't want to show the time part in my control. Instead of 8/26/2010 12:00 AM, I want 8/26/2010. Is there any easy way to do that without any explicit/implicit conversion or overriding some methods ? ...

Binding a combobox to a database and gridview

Hi, I am displaying a database table on a grid view and displaying a selected item's details in a detailsview. Here's the problem: There's a combobox in the detailsview and I want to display the added value's string on grid and I want the combobox to select this value. It will be possible to update, delete the selected item from grid o...

keyboard press without Hardware press

how can I press "Enter" on c# and WPF without pressing enter on hardware keyboard ? ...