wpf

WPF change a tooltip background in c# code

I know how to change the tooltip in the xaml side of things, but does anybody know a great solution to do this in C#? ...

Cast MenuItem to the bound object

Hello I have a SubMenu in a ContextMenu which ItemSource is set to a expression like ContextMenu.Items[i].ItemsSource = DatabaseInstance.GetAllObjects() When i handle the clicks from the ContextMenu i have this event handler: XALM: <ContextMenu MenuItem.Click="ContextMenu_Click"> C#: if (e.OriginalSource as MyObject == nu...

Image API/App which can perform image manipulation on the fly?

Do any of you know an API or application which can handle real time image manipulation? Basically if I provided an image, this app would output perhaps a silhouetted version, or perform some other form of image manipulation, like roshak type blotting? If you don't know of an application like this, do you know if this is possible using ...

WPF : How can I sendkeys to another control without taking focus away from the target control

I've followed this question and it works well, but it takes away focus from my sending control. What I'm trying to do is to create an entry box that works like an auto complete text box - a text box and a popup control that contains the list of matching items. I need to be able to take keys, such as Up,Down and route them to the popup...

[WPF] SelectionChanged of a child ListBox

Hi, I have a ListBox bound to an ObservableCollection with an ItemTemplate that contains another ListBox. First of all, I tried to get the last selected item of all the listboxes (either the parent and the inner ones) from my MainWindowViewModel this way: public object SelectedItem { get { return this.selectedItem; } set {...

WPF Keyboard Shortcut - Why is this not working?

I have the follwing code (which is not working): private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = true; if ((e.Key == Key.P) && (Keyboard.Modifiers == ModifierKeys.Alt)) { MessageBox.Show("Thanks!"); } } Why doesn't this work? The ev...

Any update to WPF 3DTools?

I've been making heavy use of the interactive 3D controls, made by some guys on the WPF team, found here http://channel9.msdn.com/posts/Charles/Daniel-Lehenbauer-and-Kurt-Berglund-Interactive-2D-controls-on-WPF-3D-Surfaces/ I've noticed there hasn't been any updates to this lately, and with WPF and .Net 4.0 just around the corner, I wa...

wpf datatrigger on an image source

Assuming the binding is right and the image files are where they shuld be, can anyone spot why the image in the xaml below won't change when the trigger evaluates to true? Cheers, Berryl <Image Source="..\..\Images\OK.png" Grid.Column="2" Stretch="None"> <Image.Style> <Style> ...

Turning the background to gray scale in wpf

Consider a window with loads of multi colored controls on it. I want to put a panel on top of this when some trigger happens in the form such that all the controls looses its color (everything appears in gray scale) except the panel which has just popped up. Can somebody help me with this ?? ...

System.NotImplementedException Exception

I got the following Design time exception for my control in WPF System.NotImplementedException The method or operation is not implemented. ...

How to make Scaling Images have clickable regions in WPF

Using an image inside of a viewbox (inside a DockPanel), I've created a image that scales with my window in a wpf application. <Viewbox HorizontalAlignment="Left" Name="viewbox1" VerticalAlignment="Top" Stretch="Uniform" StretchDirection="UpOnly"> <Image Height="438" Name="image1" Stretch="Uniform" Width="277" Source="/MyAPP;compo...

Datatrigger on textbox not working

Hi i am trying to write a datatrigger in which i have to clear a textbox content on checkbox checked.My Code is given below It works as long as you dont type anything in the textbox.As soon as i type in the textbox the datatrigger fails to work.How can i solve this <Window x:Class="CheckboxTextbox.Window1" xmlns="http://schemas.mic...

WPF create a list of items that scroll vertically then horizontally

How can I go about creating a control that has items in item that list vertically, but only to the height of the control, then start at the top of the second column? Sort of like the windows explorer look and feel. I am using a WrapPanel at the moment, but I cannot figure out how to make it scroll horizontally... Any help here is grea...

How do I bind to a RowDefinition's height?

In this example code, I'm trying to offset the Grid's Canvas position by the height of one of its rows. Does anyone see what I might be doing wrong? As you can see, I tried moving the binding lower in the xaml file, just in case the RowDefinitions needed to be defined first. Either way, it doesn't seem to matter because Canvas.Top is...

Lighter-weight elements - how does one gauge/know the weight of an element?

I'm working on the UI side of a WPF project. My favourite reference while xaml'ing (besides stackoverflow :) ) at the moment is Adam Nathan's "Windows Presentation Foundation Unleashed". He gives the following tip regarding control templates: "Rather than using a ContentControl inside a control template, you should use the lighter-weight...

When using ItemsControl ItemsControl.ItemsPanel is set to Canvas, ContenPresenter comes in and break my Canvas properties on the children [WPF]

I am using an ItemsControl where the ItemsPanel is set to Canvas (see this question for more background information). The ItemsControl is performing as I want, and it works like a charm when adding a child element manually by putting it into ItemsControl.Items: <ItemsControl> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> ...

'View cannot be shared by more than one ListView' Wpf Error

What is wrong with this code ? It throws the Exception: "View cannot be shared by more than one ListView" <ListView ItemsSource="{Binding}" SelectionMode="Extended"> <ListView.Style> <Style TargetType="ListView"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=MyControl, Path=IsCompany}" Value="True"...

WPF, RichTextBox problem in getting the right textproperties at cursor position

I'm building a simple editor using the wpf richtextbox. This editor has some sort of toggle buttons for Bold, Italic, Underlined, etc. which are 'pressed' when the selected text or the text at the cursor has the approptiate property. I did it like this: private TextRange GetSelectedTextRange() { if(_richTextBox == null) return null; ...

WPF: CollectionViewSource - uneven grouping

Hi! Im using the WPF-Toolkit DataGrid with an CollectionViewSource as Source. With PropertyGroupDescriptions I can create and display groups in the Grid. My problem is that i cannot create "uneven" groups, like: A A.A A.B B B.A B.B B.B.A B.B.B C D I want some groups that are deeper than other, and some, that are only elements ...

Is it possible to use the WPF version of the Client Composite UI Application Block (CAB) for WinForms application

I am at the initial stage of designing a client application. However, being new to WPF and having already gained some experience in Win forms development, time pressures on the project means that there is a risk to going down the WPF route. If time were no pressure, then I would say forget forms and design with WPF. However, I am not luc...