wpf-controls

WPF Quad Context Menu

N.B THIS QUESTION HAS BEEN UPDATED, READ FURTHER DOWN Hi, I want to create a custom context menu that has 4 sub-menus, each in their own quadrant (top left, top right, bottom left, bottom right). Similar to 3ds Studio Max. This is how I've approached the issue so far: - create a custom WPF control, derive from ContextMenu[1] - decla...

Stupid DependencyProperty question

I'm trying to bind the Forderground dependency property to my UIControl, so that it's drawn in the color the user wishes. Since myUiControl.Foderground autocopletes, I thought I could just bin it in the XAML file like this: {Binding ElementName=rootControl, Path=Forderground} When debugging VS says it cannot find the source for binding...

programatically add column & rows to WPF Datagrid

Hello Guys, i m new to WPF. i just wana know how should we add Columns & rows programatically to DataGrid in WPF. The way we used to do it in windows forms. create table columns , rows & bind it to datagrid. i believe WPF datagrid is bit different the one used in ASP.net & Windows form ( correct me if i m wrong). Basically i have No ...

WPF usercontrol

Hi all, I facing very huge problem now, that is I have usercontrol (created by me) which I have added on to a window... on click of button I wann show another usercontrol on window, total how can I access the window object in my control (usercontrol) Thanks all ...

Switching tabs

I have two tabs in my TabControl. I need to run a method (checks if data needs to be saved to the database) each time user switches from one tab to the other (switch can be in any direction: from tab1 to tab2 and from tab2 to tab1). How do I do this? I thought about using ButtonBase.Click event that gets attached to each tab but it does...

Problems closing tabs

I've a WPF app organized with tabs. I added a small button to each tabitem header that allow the user to close the tab. When the user click on the small button, I remove the tabItem from the tabControl. tabControl.Items.Remove(tabItem); As result of this the tabItem dissapears, and that is fine, but here comes the problem: The TabIt...

Enabling Scrollbar in WPF

I'm having a problem right now where my WPF application hides anything below the fold when the window is too small vertically. How can I use XAML to get a vertical scrollbar to appear for the entire app so the user can scroll to see the rest of the content? ...

WPF Binding Converters

I am currently stuck at a dead end with the following situation: I have a List<Category> collection with each Category containing an Id, Name and a List<string[]> property called Subcategory (where array contains the Name and Id of that subcagtegory - I didn't feel like creating another class). I have a TreeView with HierarchicalDataTe...

WPF - Error cleaning solution - Local Storyboard

Hi, I've ran into this problem I can't quite wrap my head around. I've got this WPF Application which seems to be just fine when I open in Expression Blend. It compiles and I can even rebuild the solution with no problems and no error message. But when I go to Clean Solution, I get this error: The name "SplitExpander" does not exi...

Link button in wpf

Hey Guys, How can I make Button to look like LinkButton, and I don't want to use Hyperlink...!! Any suggestions ...

Best way to write a custom gauge control in WPF?

I need to write a gauge control in WPF for a project at work. By gauge control, I mean something akin to a traditional car speedometer: a circular face with numbers and ticks around the circumference, and a needle pointing to the current value. Although I could get my employer to purchase a third-party control, or even find a free one so...

Handling Content property in WPF

I'm currently facing huge problem i.e I'm showing Image and some text in a image the problem is when I change content property of button from code, my image disappears and only assigned text is shown, I wan to retain image and just wann change the text, Any suggetions how to handle it <Button x:Name="btnPrescan" Margin="8" Grid.Column="...

How to override application styles in a wpf control created at runtime

I am trying to create a WPF control at runtime, but I can't figure out how to make it ignore the styles coming from the App.xml resources. I've tried setting the style to null and the OverridesDefaultStyle to true but no luck. The app settings set the foreground to white, and I can't seem to explicity set it to anything else. ...

Update all bindings in UserControl at once

I need to update all the bindings on my UserControl when its visibility changes to Visible. Pretty much all my bindings are bound to the DataContext property of the user control so I'm trying to update the target of that binding: BindingOperations.GetBindingExpressionBase(this, UserControl.DataContextProperty).UpdateTarget(); But I ge...

In WPF, what is the best way to create a calendar view similar to Outlook 2007?

I'm writing a WPF desktop application and have a view that needs to look like a calendar. I only need to show four weeks (fixed). Each week will have a list of items (probably represented with a ListView). I'm debating between two approaches: Using layout controls - a Grid control where each "cell" contains a ListView Using a ListVi...

Matrix(Reporting Services) look alike control in WPF

How can i create a Matrix look a like control in WPF? I want to create some similar like the one displayed in the below link. http://msdn.microsoft.com/en-us/library/ms157334.aspx Thanks Sharath ...

How do I host WPF content in MFC Applications?

I'm going to answer my own question here because I spent a few hours piecing this together and wanted to share what I found in the hope that I will save someone else the digging. There is an MSDN Walkthrough that gets you most of the way there, but there are a couple of key pieces that I found elsewhere. For example, the walkthrough te...

How to get a top object (Window or Page) in WPF?

Within my custom WPF control I want to get a containing Window or Page. Window.GetWindow() method works fine when control is in a windowed app but when it's in the XBAP app in a browser it returns browser window instead of the page. Is there any other way to do this? ...

Applying Styles in nested listview in WPF

Hi, I have a listivew inside a listview and I am displaying master detail kind of relationship. Can i apply the row color of the parent listviewitem to the child listviewitem? Please reply.. Thanks Sharath ...

Text Will not show for selected Item in ComboBox.

I feel really stupid for asking this but I have been thrashing for over 8 hours. How do I get the Selected Item to show its text in my WPF combo box when selected? Above is an option dialog that allows users to select and configure the available tournament displays. The problem is the selected combo box item shows the UserControl in...