wpf

How to move a window from the windows move event???

I have a window in wpf in which the title bar is disabled. The right button click is also disabled. But i want to move the window when the move option is clicked from the context menu of the windows taskbar icon. Can you please suggest me how the override the event in the application. ...

WPF: Changing the look of a Surface Listbox "click-effect"

Hi, I'm changing the look of some Controls that I use in my Microsoft Surface Application at the moment. And today I'm working on a SurfaceListBox. I have the template for it and already changed background and borders and other stuff. But I really cannot find where I can change the color of the rectangle that appears on the ListBoxItem...

Use Lucene Hits to Filter DataSet Bound to ListView in WPF C#?

Alright so I've got a ListView with many items available to it any time (in virtualized mode). Right above the ListView is a text box that allows the user type in any search term and the ListView will be filtered live. The ListView is currently bound to a DataSet like this: SoundListView.DataContext = DS.Tables[0].DefaultView; The Dat...

WPF binding Ancestor object as CommandParameter

I have a Custom usercontrol that I want to enlarge. I tested this whit a function call on MouseDoubleClick and it worked fine. Code: XAML <cc:UserControl ItemsSource="{Binding Path=DataItem}" MouseDoubleClick="UserControl_MouseDoubleClick" /> CodeBehind c# private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs ...

WPF WebBrowser control: mouse wheel scrolling and Document.execCommand stops to work properly after I added event handlers

I have a WPF WebBrowser control. After I added several events handlers in this way: m_eventHelper = (HTMLDocumentEvents2_Event)Document; m_eventHelper.onclick += new HTMLDocumentEvents2_onclickEventHandler(OnMouseClick); m_eventHelper.onmousedown += new HTMLDocumentEvents2_onmousedownEventHandler(OnMouseLButtonDown); mouse wheel scro...

WPF Datagrid not refreshing properly with MethodParameters

I'm having masses of trouble getting an ObjectDataProvider work with method parameters. Now with the following code, I can view the data in the XAML visual studio designer, however once I try to refresh the ObjectDataProvider my data disappears. I've setup an object data provider with five parameters, although these are not passed to t...

Binding from multiple element in wpf

I have 3 wpf control name "A" "B" "C". I want to bind C control height. Easy understand: C.Height=A.Height+B.Height This is my dream. :) < C > < C.Height > < SumBinding > < Binding ElementName=A, Path=Height/ > < Binding ElementName=B, Path=Height/ > < /SumBinding > < /C.Height > < /C > How to do it? Is it possible t...

Customizing WPF Panel to Resize.

I Wanted to have custom Panels using WPF, those I can re-size them like a web-parts. I want to use these panels as my dashboard controls. These Panels will have specific contents. User should able to resize them. And the other custom panels in my window should re-size accordingly. I wanted the panels should behave as shown in the examp...

graph# layout algorithm from left to right

is there any layoutalgorithm or way to draw nodes from left to right.... thanks ...

WPF and ADO.NET EF - error part II

Hi, I have added the connection string to the App.config of a main executable in my wpr, prism application and I get the following error: System.TypeInitializationException was unhandled Message=The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Logging.Logger' threw an exception. Source=Microsoft.Practices.EnterpriseLi...

[WPF] controls upon unfocued window doesn't effect on first click

Et least two clicks should be done to click some control on unfocused window. Window gets focus on first click and then control gets MouseClick message on second. Question: Is there possibility to click control on unfocused window by first click? ...

How to Set Screen Resolution At run time

hello all i have a problem guys i made a wpf applications its running well but when i change the resolution of my screen my all form control are not on their positions is any body tell me why this problem come and what are the solution to reform this.. thanks in advance Radhe Govind ...

two way wpf datagrid binding to database

HI all, I want to bind WPF datagrid in two way. I had tried following XAML: <Grid> <my:DataGrid x:Name="dataGrid" AutoGenerateColumns="False" Margin="8"> <my:DataGrid.Columns> <my:DataGridTextColumn Header="Header" Binding="{Binding pCode}" IsReadOnly="True" /> <my:DataGridTextColumn Header="Header"...

WPF App - MFC App interoperation

I have a small WPF application. I wish to integrate it within our exisiting systems. I have two COM servers implemented as MFC MDI apps, lets call them COM_Srv1 and COM_Srv2. COM_Srv1 needs to call a method of WPF app, say StartTask. On Task Completion WPF app notifies the COM_Srv1 app WPF app may need to invoke a method on COM_Srv2 to...

Where and how should selected items be managed in a MVVM architecture ?

Hello, I have a view that allows the user to select some data : some dates for example, and executes a command that needs these data. So in my command I should have a reference to the selected date, but what is the best practice to make this date go to the ViewModel side where the command lives : to add a SelectedDate dependency prop...

Binding ComboBox Item with a text property of different DataContext

Hi Everyone, I have a comboBox as below. What I want is to bind the selectedItem value to a Text property of a datacontext so that another DataTemplate can show the Image. Please note that the Combobox and Target Image elements are on two different DataTemplates so that's why I need to update the Text Property (ImageName) ofDataContext a...

WPF RichTextBox - Disable input on certain paragraphs.

Hi, I would like to be able to stop the user from modifying certain portions of text in my WPF RichTextBox. To do this, I am handling the PreviewKeyDown event and setting the Handled property to true so that no further processing takes place. The problem with my approach is that navigation keys are also disabled. I know that I could de...

WPF control does not capture the press and hold event (right click) when IsManipulationEnabled is set

I'm starting to make some tests with a touch screen and I've found that if a UIControl has the "IsManipulationEnabled" attribute set to true then the MouseRightClick Events fired by the press and hold gesture (WIN7) is not captured. Am I doing something wrong? public MainWindow() { InitializeComponent(); WC_Rectangle...

IEnumerable DependencyProperty throws errors when set in XAML

I have a custom control Workspace that inherits from Control and within it is a DependencyProperty that I need to contain a user-specified IEnumerable<IFoo> (I have also tried making it an non-generic IEnumerable). Public Shared ReadOnly FoosProperty As DependencyProperty = DependencyProperty.Register("Foos", GetType(IEnumerable(Of IFo...

WPF Converter with Property vs MultiConverter?

What is the difference between using a Converter (IValueConverter) and passing in other values as parameters (ConverterParameter) vs using a MultiConverter (IMultiValueConverter) and just passing in multiple converter values? ...