wpf

please explain what is themes and generic.xaml?

hello, i noticed that when i create a custom control in visual studio it adds generic.xaml into the Themes folder. what is the purpose of this folder, what is special about generic.xaml? why when i try to link to my own dictionaries from generic.xaml they do not seem to get picked up by the application? thanks! konstantin ...

drag and drop from radtreeview into grid

Can anyone suggest most accurate events handlers to be used for the below mentioned description: I have a radtreeview and i will drag radtreeviewitems (nodes in the tree) onto a grid. I want to raise an event when an item is dropped into the grid, then check whether the type of the dropped item is radtreeviewitem. ONLY if it is a radtr...

Screen with ListView has images in item template - loads slowly

I have a screen in my WPF app that contains a ListView. The ListViews ItemPanel is a VirtualizingStackPanel. There are about 500 items in the ItemsSource. Each item contains an Image which is bound to a property called Image (a string path to the image). Using the bound image, the list renders very slowly (like 3-5 seconds). Once it's lo...

Retain Content on Page1 after navigating to Page 2 and back to Page1 in WPF

On Page 1 i have controls txtBox, ComboBox and a hyperlink. TextBox has Value "ABC" ComboBox has some value "123" When i click on the Hypoerlink On Page1, i Navigate to page2. On Page2 i click on a btnGoBack which takes me back to Page1. I can actually see my values. I however cannot see the values when the controls on Page1 are bound...

WPF, Screen Refresh Forms Problem

I have windows 7 64bit (with SharePoint installed) and am building wpf application targeting 3.5 .net When running the application in debug mode, the form border shows on the screen but the contents (within the border) remains black. The contents are not loading. I tried this on my windows 7 32bit system and all works. If I change to ...

C# designer flow chart app - how ?

Hi I'm new to C# WPF. There's a flowchart WPF program in C#. The program can display objects and connecting arrows between them. ie eg ======== ======== | | | | | obj1 | ------> | obj2 | ======== ======== 1 - How do I add a visual function to each object when right clicking them ? ie when I r...

How to bind from DataGridColumn.Header to ViewModel property?

I want to bind my datagrid header to a property on the DataContext of the grid. Now, I got it to work, but I consider this a temporarily solution: <DataGrid x:Name="grid" ItemsSource="{Binding Path=Items}" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding Path=Description}"> ...

WPF TreeView's Scrollbar is inconsistent

I have a WPF TreeView that has ScrollViewerVerticalScrollBarVisibility set to Auto. This treeview is in a Border, which is in a Grid. When I start my app, it populates the treeview and the length of the treeview is too long for the panel. So I'd expect a scrollbar. And as expected about 75% of the time I get one. But about 1/4 of th...

re-entrant selected item being called with null

After a substantial refactoring complete with 100% passing tests, it turns out that firing up the UI shows it is now impossible to select an item in the list. What is happening is that the selected item is called twice - the first time with the correct item that was selected. But then it is called again with a value of null. Looking thr...

External alias in XAML

Hello, I'm currently using a library that implements Menus and ContextMenus for Silverlight 3 and 4. This library defines a MenuItem class in the System.Windows.Controls namespace. No problems with SL3 because there is no MenuItem class elsewhere in the Silverlight class library; but now I need to use another control in a Silverlight 4...

Datagrid checkbox styling

Hello First sorry for my english. I have started recently my first project on wpf. I´m styling a custom DataGrid who have been defined programatically (the xaml code doesn´t exists). I have styled all that i need in my datagrid control except a checkbox that i wrapped inside. The problem is that in other place of my application i defined...

Change WPF StackPanel background color when an element in the panel has focus

If I have a set of controls within a StackPanel, is there a generic way to change the background of the stackpanel when any control within the StackPanel gains focus? (and obviously switch the background back when no control in the StackPanel has focus). The following code works for me, but it would be nice to have a generic way to acco...

WPF: Zoom and Scroll to selection (sample)

Is there anyone who experienced with the scrollviewer component in WPF? I have a basic selection zoom, and the problem is that it does not scroll to the right place. Output, trying to zoom the flower: Actually, the RectangleZoom (see bellow) method scales the picture, but it does not focus it on the specified rectangle, but always in ...

Change the text direction in WPF FlowDocument TableCell.

I'm trying to create a simple table in a WPF FlowDocument that has rotated text in some of the cells. In Microsoft Word you can easily change the text direction of a table cell but I haven't been able to find a way in a WPF FlowDocument. Any idea on how to rotate the text 90 degrees or change the text direction. I've tried a few things...

MVVM with LinqToSQL

Hello Together, there a little BrainF*** question for me to understand MVVM in relation to LinqToSQL. The MVVM is build like: View --> Viewmodel --> Model View: the xaml and the cs code behind file. right ? Viewmodel: created by the Developer (*.cs), encapsulated properties of my Model Model: Datamodel So here is the Question: ...

WPF - Resizing chromeless windows using attached behaviors,..Any suggestions?

Who fancies a challenge? I'm currently working on the ControlTemplate for a chromeless Window which will be a part of a reusable theme assembly. I want the behaviors for moving, closing, minimizing and restoring to be implicit so I've written attached behaviors for this functionality which I've then included in the template. Now,..I'v...

wpf - HierarchicalDataTemplate, VirtualizingStackPanel, Window Resize (maximize)

Hi, I am having a problem with a wpf treeview that uses a HierarchicalDataTemplate in conjunction with a VirtualizingStackPanel. Using the code provided below, I run the application and expand all the treeviewitems. http://img227.imageshack.us/img227/3536/wpftv03.png I then make the viewport "small" so that items are virtualized. ...

Why does my WPF GroupBox looks so weird ?

I have no style set anywhere in my application! UPDATE: ...

How to repaint a WinFormsHost when it becomes visible?

I've a winforms control within a WindowsFormsHost on a WPF control. The WPF control is only visible some of the time, and when it becomes visible the contents of the winforms control have usually changed. When the ViewModel for the WPF control changes I change the contents of the winforms control and the WPF control becomes visible. Un...

WPF MVVM ItemsControl with Multiple ViewModels depending on the object type

I have a collection that holds multiple types of items that all inherit from the same interface. This is bound to an ItemsControl. The DataContext of the window is set to the ViewModel that holds the collection. What I would like to do is have each item of a different type in the collection use a different ViewModel. So if my template...