wpf-controls

change button to his binding color when pressed

i want to change my button color when is pressed : <DataTemplate> <!--Click="btn_Click"--> <ItemsControl DataContext="{Binding}" ItemsSource="{Binding}"> <ItemsControl.ItemTemplate> <DataTemplate> <Button ...

unable to set focus on controls inside tab control in wpf

Hi Experts, I am trying to set focus on my user control using attached property that is exposing a dependency property "IsFocus" in my user control and binding it to a property in my Window. Although this works fine for all controls in the window and the first tab, i am not able to set focus on controls which is on other tabs. I even go...

WPF Cloned/Detached object edit problem - what is the standard ?

Hello, I am using an ObservableCollection to wrap some of my generated entity framework objects. When the user wants to edit some values , i am opening a popup windows that contains fields, and when the user changes and press save - the changes are saved to the database, and the binded controls are changes as it is an observablecollect...

How to update iFrame source from twolistboxes on selected item value???

I have a two listboxes where I generate content from XML. I define UriSource in XML. I'd like to find out how I can update Frame's Source property from two different lisboxes. Any ideas are highly appreciated. XAML: Listboxes and Frame: <Grid x:Name="PANEL_BottomArea_Grid" DataContext="{Binding Source={StaticResource PagesData}}"> ...

What's the best way to create a WPF TextBox that replaces spaces with underscores?

I'm creating a FilteredTextBox in WPF that subclasses the included TextBox control. The FilteredTextBox must only allow characters in the range [a-zA-Z0-9_] to be entered, and I've got that part pretty much working. I've hooked into OnPreviewTextInput to handle typed characters, OnPreviewDrop to filter characters that are dragged and d...

Create common context menu in WPF

In my app I have many grids (Infragistics). I would like to create a context menu that will implement many of the common functions ie: delete, save layout, etc. and if a specific grid needs more than the common functions be able to add to the menu for that grid. I would like to create one context menu and not have to repeat the same co...

Finding a Visual beneath my own using WPF VisualTreeHelper advanced hit-testing

I have a seemingly simple task. Imagine a point, a visual tree and some Visual (point is within Visual). I want to use advanced hit-testing to get my hands on the first "leaf" Visual that is "behind" my own Visual. I have used VisualTreeHelper and its fancy hit-test methods but could not get the results I wanted. ...

How to change the appearance of any control when property changes?

I'd like to highlight to the user anything that has been modified, so that they know what they have changed or what has been programatically changed behind the scenes for them. I want to use styles to apply this logic to all my controls, but i'm not sure how. I know I need to create a trigger but not sure what to trigger on exactly or h...

WPF TreeView Nodes becomes unselectable after adding children nodes

I have a huge issue with the WPF TreeView. I have setup a tree that is similar to this. <TreeView DataContext="{Binding Projects}"> <Style TargetType="TreeViewItem"> <Setter Property="IsExpanded" Value="True" /> </Style> <TreeView.Resources> <HierarchicalDataTemplate x:Key="LoadTemplate"> <Grid> ...

[WPF] ListView Losing Selection before Start Drag

I got a ListView Like the following. The User is supposed to select some Items and dragDrop to somewhere else. This does not require CTRL+click which is good. but after all the selection are made, when I try to start drag, the left click un-selects teh item that got clicked. How can I make this behave like windows explorer, so the select...

ControlTemplate

Hi, I am quite new to WPF and have a basic question : Assume the following is xaml declaration in my xaml file <ContentControl x:Name="interactionActivityContent" Loaded="interactionActivityContent_Loaded"> <shapes:BaseShape.DragThumbTemplate > <ControlTemplate x:Name="interactionActivityTemplate"> <Grid AllowDrop="True"...

How to inherit from ListViewItem in WPF ?

I need to create table that all ListViewItem of this table will be build hold 1. Image 2. Text 3. Button How can i do it ? ...

Multiples selections Problem, with a Single Click (WPF ListBox)

Hi to everyone, this is a problem i am having with a WPF Control, it's like an address bar where the user can pick a directory from a pop up window, that last pop window became filled with sub-directories of the selected one, only in my case the selection happens 2 times, sometimes 3 or 4. how this is happening,I, absolutely, have no ide...

Capture hyperlink click in HTML displayed in WPF Frame

Hello, and sorry if that was asked before, With a WPF Frame Control I can display a website. WPF appears to delegate Rendering to the resident IE installation. Unfortunately it appears that when I click some link in the displayed page, WPF does not register this as Navigation, e.g. Navigating event doesn't fire. I can almost imagine w...

Rendering TabItem in WPF (with powerhsell)

Probably a simple question, but my brain isn't working today. I am writing a small powershell script to do various tasks. These tasks are logically grouped into tabs, using a WPF TabControl. A couple of the tabs do some checks to compare local file dates with server file dates, which takes a bit of time. (Only a few seconds, admittedly...

How to write ListViewItem that contain image , text and button ?

I need to write some listViewItem ( using WPF ) - that contain image, text and button. I want to inherit from the simple listViewItem class and add to the listview item that contain the three items ( image, text, button ). I don't understand how the listView control will arrange the 3 items ( image , text, button ) in the right order...

WPF TreeView template not displaying ContentPresenter

Hi there, I am in the process of customizing a treeview contro, well its actually the treeview items. My understanding of a hierarchical control is more or less teh same as a non-hierarchical control like a listbox. So maybe if I explaing that you can tell me where im going wrong. When customizing a non-hierarchical data control I basic...

WPF Events - How to map the XAML to an event on the base class?

Hello, I am using a base class to my Popup windows on a WPF application. Everything looks and works great beside one thing : I cant map an event handler that is on the base class to the xaml. Ofcourse i can easily have the event on the implemented class, and use the method to call the base class, but i just wanted to know if there a wa...

How to get FrameworkElement properties before its unloading

Hello It is need to realize UI settings system - loading/saving some properites of UI elements (which can be modified by user in runtime) from/into persistent storage. For example: DevExpress grid control - columns width's, visibility, summary area and so on (this control has set of methods pairs like RestoreLayoutFrom/SaveLayoutTo, b...

Why my checkbox override does not work ? ( code attached )

I try to create 3 state button. This control will will change the image on each of those 3 state ( normal, pressed, mouseOver ). The images of each state will be define as a property from the c# code ==> that mean i will be able to re-use this code and change the properties of the image source. The Xaml: <CheckBox x:Class="StateButto...