wpf

How to get Node Types in a tree using C#

hi all, i want to get the type of each node in a TreeView of a WPF. please help me. ...

Convert WPF XAML to Silverlight XAML

I have question about using XAML across the WPF and Silverlight platforms. Background: I have a silverlight app that needs to pass the Xaml to WPF and do some calculation to update the XAML. When I run the changes in WPF, I parse the XAML and convert it to the Canvas object which does the job perfectly fine. The problem is WPF strip ou...

wpf weird MenuItem visibility issue

I have simple scenario in which i hide and show a signle MenuItem in a contextmenu as shown below: Xaml: <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.ContextMenu> <ContextMenu Nam...

WPF Icon for all app windows

It is possible to set one Icon so, that it would be used on every window in current app. So that i set it once (not on every window by hand)..? ...

WPF and WCF User Configurable Fields

Hi I have a requirement whereby a user can specify a variable number of user-defined fields, for example in an xml file. These fields have a user-friendly name which is displayed in the GUI, and a code which is used to persist and retrieve the value of the field to the database. The problem is that I need both my WCF service to consum...

Setting WpfToolkit datagrid column editing style.

Hi, How to make a single datagrid column editable if a particular condition is true? I'm using MVVM pattern in my application. Model :: public class Book : INotifyPropertyChanged { public int BookId {get; set;} public string Title {get; set;} public string SerialNumber {get; set;} public bool CanEditSerialNumber...

Freezing columns in wpf datagrid

I have some tabular data which has a lot of fields in it, and when my WPF application is resized a lot of them are cut off. However, I want to see the first 6 columns always as they are important. How can I achieve this in a grid format? I am using the WPFToolkit DataGrid but can be persuaded to change to a different control if one exist...

Blend 3 VSM in WPF

I started what I thought would be a simple thing. A blend 3 project (WPF) that utilizes VSM to control the opacity of some images. For a wizard, to show what step you are in. Easy right? I've used this in the WPFToolkit, no problem. Introducing System.Windows.Interactivity - ahh, something new :) When I try and run the following code, ...

WPF ListBox virtualization screws up displayed items

Problem We need to efficiently display a large (>1000) number of objects in a WPF ListBox control. We are relying on the WPF ListBox’s virtualization (via VirtualizingStackPanel) to efficiently display these items. Bug: The WPF ListBox control does not display items correctly when using virtualization. How to Reproduce We have distil...

WPF - navigating to a frame in multiple ways causes error

I have a WPF window and a frame within the window that contains most of my content. In some cases, I will navigate directly to a URL with the frame and this will cause my frame.Currentsource to populate properly. However, in other cases, I will create a page object and then put the object directly in the frame.Navigate method but this wi...

WPF composite control not databinding properly

I am experiencing a weird problem. I have a WPF form into which I insert a UserControl which presents the user with a view of what they are currently doing. So I set MyControl.ViewObject = SomeCompositeObjectInstance, and then add MyControl into my form to make it visible. SomeCompositeObjectInstance has a property of another class ty...

How to write a Kiosk application in Windows that has control from startup?

I'm not sure if this is technically a Kiosk, but it's basically the same idea. I have a program that runs full screen all the time from boot to shutdown to control a machine that the computer is hooked to. Right now I just have a shortcut to the exe in the Startup folder so it starts when the system boots up and logs in. Is there any be...

Handling ObservableCollection CollectionChanged Event

I've seen code like the following in the Silverlight toolkit and can't understand how it is safe to do: private void ItemsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { // Update the cache if (e.Action == NotifyCollectionChangedAction.Remove && e.OldItems != null) { f...

Wpf (or silverlight) selecting and dragging multiple thumbs

Hello, I have a CustomPolyLine class which connects several thumbs. th user is able to drag those thumbs. now i need to be able to select and drag the whole structure, by selecting multiple thumbs. how can i do this ? ...

C# sample syntax question

Please, help me with to understand this piece of code: protected Customer() { } in the following class (Model class from sample WPF MVVM app): public class Customer : IDataErrorInfo { #region Creation public static Customer CreateNewCustomer() { return new Customer(); } public static C...

wpf - thick client or thin client and what about when wcf comes in to play with SOA!

I usually work on web apps or faceless apps with the occasional winforms utility so I'm in need of some help to clarify my understanding of WPF and terminology. I would term ASP.NET apps as "thin client" apps because apart from some javascript the bulk of the applications work is done on the server. In the same way I would view a WPF ap...

What is IDataErrorInfo and how does it work with WPF?

While working on some custom validators in WPF, one of my co-workers pointed me out the IDataErrorInfo. I have a sample view in XAML that has a textbox and a button. Based on the value in the textbox I would like the button to be either enabled or disabled. My co-worker suggested that extending the IDataErrorInfo in the presentor of my v...

LINQ to SQL update problems in WPF application

Hi everybody! I'm developing a WPF application (.NET 3.5SP1). The scenario is this: 1.using SQL Metal to extract the entity definitions (and the corresponding map file), which were afterwards used for the Data Access Layer (so i'm using LINQ to SQL). 2.using Unity (this application is "PRISM based") to register abstract classes and the...

Create window on desktop layer

Hi! I want to create a window that always stays on the desktop layer - all other windows should be above it, but it should also always be visible. I'm currently calling SetWindowPos with HWND_BOTTOM when the window is Activated or Loaded. This does keep the window below other windows, but when pressing Win+D or, in newer windows version...

Get owner of context menu in code

Hi, I have a context menu like this: <StackPanel Orientation="Horizontal"> <StackPanel.ContextMenu> <ContextMenu> <MenuItem Header="Delete" Click="OnDeleteClicked" /> </ContextMenu> </StackPanel.ContextMenu> </StackPanel> And I need to get the instance of the StackPanel that owns that ContextMenu. I already ...