wpf

change of focus in WPF window

Hi, I was wondering if there is a way to find out that the focus is not on the my WPF window, so I can capture the name of the window which has the focus on? thanks, ...

Printing a dwf/dwfx file from WPF

I'm currently attempting to print a document from WPF. I'm using the web browser because it contains an active x control which has the autodesk plugin which I need to view the document. I'm aware that WPF doesn't directly support web browser but I've just integrated the Windows Forms library for this. I've managed to get the code runnin...

Using DataBinding values to update Width of a Control (WPF)

Hello, I created a user control and an associated view model. The properties "DisplayName" and "TimeIntervalLength" of the view model are displayed in the user control view DataBinding. Depending on those properties of the view model I want to update the width of my control. The width should be "TimeIntervalLength" but at least "Display...

How can I loosely reference modules in Prism so they can or cannot exist?

In this stackoverflow question I learned that Prism/Unity is not as decoupled as I thought, e.g. if I have this class which gets menuManager injected into its constructor, then I have to make sure that this class actually exists somewhere (I thought that you could just pull the .dll that contains the class and the container would deal wi...

ScrollViewer not showing up properly?

Does anyone know what's wrong with my code: <Border Background="AliceBlue" BorderThickness="2"> <Grid Name="MainGrid" Background="DarkGray" > <Grid.RowDefinitions> <RowDefinition Height="0.02*"/> <RowDefinition Height="0.07*"/> <RowDefinition Height="0.63*"/> <RowDefinition Hei...

WPF - Bind based on type of member object?

Lets say the model looks like this: (plants are easier to describe than telephony system acronyms) class CornAttribs dim numKernels class OnionAttribs dim numLayers dim color class Vegetable Implements INotifyPropertyChanged ....snip notify related stuff dim name as string dim attrib as object 'point to Co...

XAML tooltips are being clipped

I am trying to make a WPF app (regular Windows app, not XBAP or Silverlight). I want the main app window to support transparency, and show through the desktop below. But when I specify ToolTip text on a Button, the ToolTip appears beneath (z-order) the main window! I have a screenshot where: * Another app overlapps and blocks view of t...

WPF MVVM: Find out on which header context menu has been clicked

I am trying to use the MVVM pattern to write a WPF application. I am using WPF data grid (from the toolkit) which lacks the autofiltering feature. So I want to implement it. I've added a context menu to the column header template, it has MenuItem called "Filter" which should actually call the filtering method. So I've set a MenuItem's ...

Can I use the WPF WebBrowser control as a UI interface in C#?

Is it possible to use the WebBrowser control as a UI interface in C#? I like to write a string of HTML directly into the control and get an event and read the value of the hyperlinks when such a link is clicked. HTML is a great rendering language and it seems to be a waste if we could not use this technology in applications. If this ...

WPF Tab Into Databound ItemsControl

In my WPF application, I have a databound TextBox and a databound ItemsControl. The contents of the ItemsControl is determined by the contents of the TextBox. I want to be able to type a value into the TextBox, press tab and enter the first item in the ItemsControl (created from the value in the TextBox ). The problem I am having is tha...

Is it possible to configure a GridView to show pivoted data using static XAML if column info is unknown at design time?

Hi, I was recently, um, chastised for generating and loading XAML markup at runtime using XamlReader.Parse(). I was told that there's no reason to use XamlReader--it can always be done with static XAML, predetermined at design time. I attempted to ask this person how I could construct a GridView to show pivoted data, where the number of...

WPF GridViewColumn MouseDown

Hello, how can I implement a MouseDown event in this object? I already have an object called NamedGridViewColumn that inherits from GridViewColumn and implements a Name attribute, so I want to add a MouseDown event there to. Any idea how? (Preferably in C#) Thank you. ...

XAML Alternatives

I love WPF, but I hate XAML. XAML is too verbose, has syntax issues when Microsoft tried to extend it (see StringFormat on Bindings), and is difficult to navigate. Are there any alternatives to XAML? (These are just my opinions. Feel free to disagree.) ...

How do I Get a WPF DataGrid to Save Changes Back to the DataBase?

How do I get a WPF DataGrid to save changes back to the database? I've data-bound my DataGrid control to a DataTable object, and populated that table with a very simple SELECT query that retrieves some basic information. The data shows up just fine in the control. But when I use the control to edit the data, the changes are not pus...

Placing arbitrary controls in InputGestureText area (WPF Menus)

I'd like to put an image on the InputGestureArea of a WPF menu. Normally only string values can go there. I'm guessing the solution involves style tags, but I'm a complete noob to XAML/WPF, so any help is appreciated. ...

wpf shader template

I used the shader templates given through Greg Schechter's blog: http://blogs.msdn.com/greg_schechter/archive/2008/08/11/a-visualstudio-buildtask-and-project-and-item-templates-for-writing-shadereffects.aspx It was all simple to add the wpf shader templates and create the project. I'm also able to see that the shader is working through ...

WPF won't let me put a binding on the path of a binding -- is there another way?

I have a DataTemplate that I'm using as the CellTemplate for a GridViewColumn. I want to write something like this for the DataTemplate: <DataTemplate x:Key="_myTemplate"> <TextBlock Text="{Binding Path={Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type GridViewColumn}}, Path=Header}}" /> </DataT...

Dropdown button with "search" Textbox using C#

Hi, I have to add a "Search Box" with a DropDown Button for searching the books. This dropdown button should have an arrow pointing downwards and the search textbox next to it. so, wen i click on dropdown button, i should get few options (like team, personal, e........) If i select Team then the text "Search in Team" should be displayed...

In Prism, how do I inject an interface into my module constuctor instead of a type?

In my prism application I'm getting the error Activation error occured while trying to get instance of type CustomerModule, key \"\". It's caused by the fact that my customers module I'm trying to inject a "menuManager" of type IMenuManager: namespace CustomerModule { public class CustomerModule : IModule { private rea...

Bind to ICollectionView.Count property in XAML

Hi all, I'm trying to bind a text box to the count of a filtered, collection view in XAML. It doesn't generate any errors but it also doesn't produce any output. Does anyone know how to do this? Here's are some snippets of my XAML: <Window.Resources> <CollectionViewSource x:Key="MyView" Source="{Binding MyBinding}" Filter="MyFilte...