wpf

WPF Debugging AvalonEdit binding to Document property.

Hello, all day long I am sitting and trying to find out why binding to AvalonEdits Document property isn't working. AvalonEdit is an advanced WPF text editor - part of the SharpDevelop project.(it's going to be used in SharpDevelop v4 Mirador). So when I set up a simple project - one TextEditor (that's the AvalonEdits real name in the ...

WPF ComboBox Binding to non string object

I'm using MVVM (MVVM Light Toolkit) and have a property on the view model which exposes a list of objects. The objects contain two properties, both strings, which correlate to an abbreviation and a description. I want the ComboBox to expose the pairing as "abbreviation - description". If I use a data template, it does this easily. I ...

How to cause bindings to be updated, particularly for derived values?

I'm using some CLR objects that use the INotifyPropertyChanged interface and use the PropertyChanged function to update in WPF bindings. Pretty boilerplate: protected void RaisePropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }...

Can't pass a single parameter to lambda function in MVVM Light Toolkit's RelayCommand

I don't know if there's a difference between Josh Smith's and Laurent Bugnion's implementations of RelayCommand or not, but everywhere I've looked, it sounds like the Execute portion of RelayCommand can take 0 or 1 parameters. I've only been able to get it to work with 0. When I try something like: public class Test { public Relay...

NavigationWindow Click Sound

I have a WPF application that uses the navigation window and frames to navigate between xaml pages. Every time it goes between the pages it makes a click sound. Is there a way to disable that? So far I have tried this: namespace FrameTesting { public partial class MainWindow : NavigationWindow { private const int FEATURE_DISABLE_...

Measure "Inline" length in WPF

Hi , I'm looking for a way to measure Inline (System.Windows.Documents.Inline) length without working with FormattedText... Is there some build in functionality for that purpose? I couldn't find any. Thanks, Eden ...

How can I access windows file preview icons from my WPF application

I got a bunch of Pictures and Videos in a directory and needs to be displayed in the WPF application, I am thinking about displaying the Win7 Large Icon itself as the preview image. Because that will save me the work of grabbing an appropriate frame from the video file since Windows is doing that job pretty well already. Any code snippet...

Making selectable again a WPF TreeviewITem after the first click

Hi, I have a TreeVIew WPF with 2 Levels of Data. I have deleted the ToogleButton from the TreeViewItemTemplate. Now I'd like to expand / collapse the groups with a single mouse-click (not with a double click as the default behaviour). I have tried in this way: Private Sub tvArt_SelectedItemChanged(ByVal sender As System.Object, _ By...

WPF Binding XAML vs C#

Hello, I've got a strange problem - binding created through XAML (both ways by markup extension or normal) isn't working(BindingOperations.IsDataBound returns false and in fact there is no Binding object created). When I do literally the same from code everything is working perfectly. One more thing is that the Binding in XAML is create...

How can I bind dynamic data to DataGridTemplateColumn when using template selectors (in code)?

I'm using DataGrid from CodePlex. [Summary: How to use bind dynamic data (a property of an object specified by dynamic name) when using template selectors? Alternative solutions would be accepted as well. I've been thinking about making my own based on BoundColumn, but someone was having problems with that approach.] I have objects (IC...

Whether we can use WPF in .NET 2.0 ?

If it is possible, pls explain me how we can implement WPF in .NET 2.0 with C#. Thanks.. ...

Change layout of menu to look like a treeview

Hi everybody! How is it possible to change a WPF menu control layout to look like a treeview control? Thaks in advance ...

Redirect application's graphical output in Windows Vista/7 (with DWM)

I want to create a desktop manager that takes informations of all running applications including states and screenshots to display and manipulate them in my virtual space (probably in 3D). It can be considered as another layer of abstraction on top of Windows itself. Because many native Windows Vista/7 features like Flip 3D and Live Thu...

How do I measure the size of a TextBlock in WPF before it is rendered?

I have a WPF DataTemplate with two TextBlock controls (stacked) and then some other elements underneath. Due to some complicated layout code, I need to know the height of the two TextBlock elements so that I can draw some fancy connector lines, and line up other controls, etc. If I know the text that's going into the TextBlocks, and I ...

View - ViewModel - Entity Framework 4

I'm looking for a simple way to link a view to a viewmodel and then to Entity Framework through databinding. Can someout out there give me some pointers. What I'm looking for is a very simple implementation that would allow the view to automatically list all the contents of for example a one field table and for changes in the view to b...

Wpf binding to a function

I've a created a simple scrollviewer (pnlDayScroller) and want to have a separate horizontal scrollbar (associated scroller) to do the horizontal scrolling. All works with the below code accept I need to bind the visibility of the associated scroller. I can't simply bind this to the visibility property of the horizontal template part...

why Dependency properties are "static"?

why we are declaring dependency property as static ? ...

Vertical separator in WPF Ribbon

How can I add Vertical separator to WPF Ribbon, to RibbonGroup? I have tried something like that, but i got horizontal separator istead of vertical. <r:RibbonGroup> <r:RibbonButton Command="{StaticResource SomeButton}" /> <r:RibbonSeparator></r:RibbonSeparator> <r:RibbonToggleButton IsChecked="False" Command="{StaticResource Ano...

Random Access Violation Exception in WPF Application

Hi, I am facing weird problem while running regression tests on my WPF Application. I am getting AccessViolationException with different stacktraces each time. First : Message :Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace : at MS.Win32.PresentationCore.UnsafeNativ...

i can't see a context menu of WPF windows app through VNC

I can open a context menu but cannot see the opened menu list through VNC. (I know that i can open the context menu by checking the vnc server machine directly) I tested on different vnc servers / clients machines (although all of them are windows Vista), and different wpf app, but still I cant see any menu list. Is this a reported prob...