wpf

How can I activate/deactivate a module's view after its initialization?

This relates to Composite Application Guidance for WPF, or Prism. I have one "MainRegion" in my shell. My various modules will be loaded into this main region. I can populate a list of available modules in a menu and select them to load. On the click of the menu I do: var module = moduleEnumerator.GetModule(moduleName); moduleLoader.In...

Make a WPF Window behave like a Context Menu (show/hide it properly)

I want to make a WPF Window that behaves like a context menu. So, for instance - when I show the wpf window, I want it to be the topmost window and from there on out, if the user clicks anything outside of that window I want the window to be hidden again. So far I have tried quite a few techniques but the only one that I found that kin...

How to open a WPF Popup when another control is clicked, using XAML markup only?

I've got two controls, a TextBlock and a PopUp. When the user clicks (MouseDown) on the textblock, I want to display the popup. I would think that I could do this with an EventTrigger on the Popup, but I can't use setters in an EventTrigger, I can only start storyboards. I want to do this strictly in XAML, because the two controls are in...

How can I get an ListView item from the (X,Y) position?

I am dropping something in a ListView in WPF. I need to know the item in the (X,Y) position I am dropping. How can I do this? ...

WPF Template Binding in ToggleButton UserControl

I'm developing a basic dip-switch user control as a personal learning exercise. Originally I had it set up where you could declare some custom color properties on the user control, and they would be used on elements inside the control. However, I recenly discovered ToggleButtons, and rebuilt my control to take advantage of them. Since t...

In WPF, how can I determine what column/row in a grid a control is

I am building a grid dynamically and putting buttons in one of the columns. When I click a button, I want to know what row of my grid it's in. How can I find this? ...

Good open source Reporting tool/framework for WPF (C#).

I am looking out for a good open source Reporting tool/framework for windows based application (WPF). The database I am using is sql server 2005. The typical reports format which I am interested is for e.g. Trial balance, balance sheet, etc (typical banking / finance reporting application). There should be good support for charting...

How can I make a Button with multiple content values?

My goal is to make a Button that has two Content values. Imagine a Scrabble tile as a button: it has the large letter in the center and a small number in the lower right. This is the effect I am going for. I made a button that has two ContentPresenter objects in it, and I have given each of the ContentPresenters a different style. ...

C# and WPF: Programmatic Control

I'm learning WPF, and seem to have found something a little odd, which I can't find the reason to anywhere I've searched. I have a window with one checkbox on it called "chkTest". I have it set to be true by default. The following code is what I don't understand. Basically I'm trying to set the "chkTest" control to a control I create...

What WPF book covers GetContainerForItemOverride and related in detail?

What WPF book covers ItemsControl.GetContainerForItemOverride and related in detail? Additionally I would like to read about why TreeView overrides it and how IsItemItsOwnContainerOverride is related to it. ...

WPF TreeView with horizontal orientation?

What would be the bast way to change the orientation of the WPF treeview. I would like to work the expand-collapse-functionality to work left to right instead of top to down. I.e. when I click on on the expand button of a treenode I would its subnode to appear right of the parent and the indent should work top-down instead. Also the vert...

WPF How to get a UserControl to inherit a Button?

I created a UserControl which consists of a couple ellipses and labels. I added it just fine to another form and things were looking pretty snazzy. Then I went to start adding some event handlers and discovered that the control I made did not expose a Click event. Oops. Easy to fix, right? Just go back to the code-behind on the User...

Window "on desktop"

Hello, I've been using Rainlendar for some time and I noticed that it has an option to put the window "on desktop". It's like a bottomMost window (as against topmost). How could I do this on a WPF app? Thanks ...

What is a good way to display dynamic data in WPF?

I am struggling with the best way to handle a WPF application that has dynamic data updates. Should I use the rich data binding provided by WPF or not? I will simplify my problem domain as much as possible in the discussion below, and briefly mention some solutions. I am very interested in whatever comments this community can provide. ...

How could I implement this strange WPF TreeListDataGridView?

As you can see in the image below I have a tree datamodel consisting of groups that can contain other groups plus an arbitary number of items wich again can hold Parameters. The Parameters itself are defined globally and just reoccur in the items. Only the parameter's actual value may differ from parameter usage to parameter usage in the...

How to position User Control in the parent canvas

I want to place this User control at Canvas.Left="168" Canvas.Top="213". However, the control appreas at a corner.What should I do? If I put the values at the point of usage, for this class the values are returned as NaN In that case how can I get the correct Left, Top Values? Usage: <Canvas x:Name="DesignerCanvas" ClipTo...

Databinding ListView including its columns

I have a list of objects where each contains an arbitary number of parameters (name,value pairs). Now I want to bind the list of objects to a listview. Each column should represent a parameter (the column header is the name of the parameter) and each row an object with the list of parameter values. How can achive that the columns includi...

What is the best pattern for WPF events?

Hey, i'm extending some WPF controls, and need to implement some custom events. I've read around about the 'event' keyword and method groups, but im not sure how to implement this in code. Would anyone be able to provide a simple example of a custom event/handler/etc? Thanks! ...

WPF - How do i insert my proxy credentials in WebBrowser Control

Hello, i m using a webbrowser control in wpf to show a virtualearth map, but because i m developing behind a proxy of my company, every time i try to see the map, i have to inser my credetials, i would like to insert them automacly in the c# code, how can i achive that? i alreadt try in the navigating event of the web broweser using: ...

Disabling text selection in DocumentViewer

Hello! Simple question. How do you disable the text selection of DocumentViewer in WPF? This is the feature where an XPS document is displayed by the viewer and then text can be highlighted via mouse. The highlighted text can also be copied but I have already disabled this. I just don't know how to disable the highlighting. Thanks! ...