wpf

Drag & Drop in Treeview wpf

Hi All, im trying to drag and drop files in my treeview but i have no idea why its breaking down if i run it and try dragind a file. i'm basically a newby in wpf and the code below is as far i can try please somebody help me on this. private void TreeViewItem_Drop( object sender, DragEventArgs e) { TreeViewItem treeView...

In databinding, how to find which control invoked the "getter" of a property data-bound to it, when the PropertyChanged event is raised?

Hi, I am developing a Silverlight 3 application, in which I have a boolean property in my Model class (using MVVM approach) that's bound to "IsEnabled" target property of two buttons. I need to find out which button invoked this boolean property when I raise the PropertyChanged event (i.e. during databinding). Is there something in the...

Listbox MousedoubleClick in WPF

Hi, I have code written on my Listbox mouse double click. I have a submit button too in my form . On mouse double click i want a mouse double click event to be fired first and then the button click Is it possible? Please reply Thanks Sharath ...

How can I tell my DataTemplate to bind to a property in the PARENT ViewModel?

I've got the following MainView.xaml file that works well as a MVVM menu switcher. I've got these pairs: Page1View / Page1ViewModel Page2View / Page2ViewModel in my MainViewModel I fill an ObservableCollection with both ViewModels, then when the user clicks the Next button, it calls NextPageCommand in MainViewModel which switches out...

WPF Canvas Button?

Hi All I'm learning WPF at the moment. I have a vector graphics canvas that I'd like to use as the background for a button, but I can't seem to find a way to do this in the documentation. I thought this would be an obvious thing to want to do. Regards, Mark ...

Setting a style's TargetType property to a base class

Hi, I was just poking around a bit in WPF and wanted all elements on my Window to share the same margin. I found that all Controls that are capable of having a margin derive from FrameworkElement so I tried the following: <Window.Resources> <Style TargetType="{x:Type FrameworkElement}"> <Setter Property="Margin" Value="10" /> </Sty...

How to select and deselect all items in a listbox using radio buttons in C#

I want to select all the items in listbox. Here iam using listbox1.selectAll() for selecting all items. And for Deselecting all items in a listbox iam using listbox1.selecteditems.clear(). thats working perfectly Now i want to do validations like if i select all items by using listbox1.selectAll() and then if i select one item in listbo...

WPF Hyperlink Image

Hi, In my app I want to resize thumbinal Image when I click it, all images are in ItemTemplate where its Source property is bind to url to picture. I try something like this (this is in my DataTemplate file) <TextBlock> <Hyperlink TextDecorations="None" Command="helpers:StatusesCommands.ShowPicture" C...

tabbed document interface in WPF using only on-board means?

I've seen two threads here about TDI & C#. Both of them didn't really answer the questions I have ... Since TDIs are pretty much like a standard nowadays, I can hardly imagine, that I have to buy a special control (like AvalonDock or SandDock). This must be possible with built in the tab-control(?) somehow! I don't need special feature...

How to autoscroll on WPF datagrid

Hi, I think I am stupid. I searched now for 15 minutes, and found several different solutions for scrolling on datagrids, but none seems to work for me. I am using WPF with .NET 3.5 and the WPF Toolkit DataGrid. My grid gets updated when my observable collection changes, works perfectly. Now, my DataGrid is located inside a normal Grid ...

WPF - UIElement.RenderSize not working for Line shape

I'm trying to make some drawing application and I get strange results in my "selection mode". If I draw a rectangle and "select it" RenderSize returns proper Size for it, but if Line is selected RenderSize returns Size which has Width set as Line.X2, and Height set as Line.Y2. For example: Line begins at X1 = 50, Y1 = 50, ends at X2 = 13...

DropDown WPF GridView

How implement selectable GridView embedded in WPF ComboBox. ...

Another DataGrid Binding Question

Hello there! I'm hoping that one of your WPF/DataGrid/Binding gurus can help me out here. I've done a bunch of searching on the subject and while datagrid binding tutorials and tips are plentiful (and I feel like I've read every single one of them), I'm still stumped on this piece. My setup is this: I have an application that has a b...

How can I emulate multiple-inheritance and use reflection to optimize this code?

I've got a WPF application where PageItems are model objects. My main ViewModel has an ObservableCollection of PageItemViewModels, each one building itself from its matching PageItem model object. Each PageItemViewModel inherits from the abstract class BaseViewModel in order to get the INotifyPropertyChanged functionality. Each PageIt...

How do I remember a WPF XmlDataProvider bound Treeview's IsExpanded property when refreshed?

I have a WPF treeview that is databound to an XmlDataProvider - the XML source is used by many PCs. When the XmlDataProvider is refreshed all the TreeViewNodes collapse. I would like each PC to remember the status of the IsExpanded attribute. I understand that I could add an IsExpanded property to the XML, however then this would be u...

Toggling between WPF controls

Is there an easy way in WPF/XAML to toggle between two types of controls in the same position in a panel? I'm wondering if there are alternatives to toggling visibilities. In my application I have several checkboxes that are used to configure a bit field (the checkboxes toggle individual bits on or off). Sometimes it is easier for the u...

When user clicks on icon area of MenuItem, DelegateCommand does not fire.

If you use the DelegateCommand in the MVVM Template and build menus dynamically as in the code below, then the DelegateCommand will not fire when the user clicks on the icon area on the MenuItem. Is there anyway to either fix this or make the icon area (to the left of the header) disappear? MainView.xaml: <Window x:Class="TestMenuMvvm...

Snapping / Sticky WPF Windows

I'm looking for solution to add snapping/sticky windows functionallity (winamp-like) to existing WPF application. Same thing as it was asked here, just I need it for WPF. It doesn't have to have docking function, just to snap to border of other windows inside same application and edge of screen (including taskbar) if possible. Preferabl...

How to connect ViewModels to their appropriate Views dynamically?

I have a WPF application which has a MainView.xaml Window which loads numerous page objects at runtime, loads them into ViewModels, and displays them dynamically in the menu. My MainViewModel has an ObservableCollection of ViewModels and I bind these each to their appropriate Views in the MainView.xaml file. However, is there a way to ...

Listbox in WPF

hi, Is there any sample For Popup form with listbox using WPF. Please reply Thanks Sharath ...