wpf

WPF: copying of XmlElement

I create a window in WPF. The constructor takes a "ref XmlElement settings" which is used to display information in that window. In the constructor, I clone those settings: _ClonedSettings = (XmlElement)settings.Clone(); and I keep a pointer to the original settings: _OriginalSettings = settings; The UI modifies _ClonedSettings. Then ...

How can I get the position of a child element relative to a parent?

If a have a Canvas parent, it is very easy to get the position of a child: Canvas.GetLeft/Top (child) But how can I get the position of a child for other types of parents? ...

WPF: displaying XML attribute as a checkbox

I have this XmlElement, and add some attributes to it: xmlElemMux.SetAttribute("test1", "1"); xmlElemMux.SetAttribute("test2", "0"); I can display those in a window using a textbox like this in the xaml, after setting the DataContext of my grid to xmlElemMux: TextBox Text="{Binding XPath=@test1}" TextBox Text="{Binding XPath=@test2}" T...

ListBox, VirtualizingStackPanel, and Smooth Scrolling in WPF

I have a ListBox that may have many rows of templated DB records, including an Image, bound to an ObservableCollection. Sometimes the Collection could hold thousands of items. The performance is great, but the Scrolling is the default jumpy behavior. I would like it to have Smooth Scrolling, so I unchecked ScrollViewer.CanContentScrol...

WPF - Static Linking of DLLs

I have a WPF app that I want to send to others so they can use it. I have several 3rd party dlls that it uses. For ease of installation I would like to have one exe that just runs. Is there a way with WPF apps (and C#.NET in general) to say "Link in the DLL files"? (I am using visual Studio 2008 SP1.) ...

What precisely does Perforator measure to determine a WPF application's frame rate?

The WPF profiling tool Perforator can display the frame rate of a running WPF program. Does any know precisely what it is measuring about the program to calculate this figure, and if it possible for a program to measure its own frame rate in the same way? ...

Do I have a memory leak in my WPF Navigation?

I'm looking through a WPF application looking for a memory leak (using ANTS Memory Profiler 5.1) and I keep seeing some pages and controls taking up memory when they shouldn't be. So I go to the Object Retention Graph and to see what is keeping them around, and I keep seeing this for every page: The thing is, I have KeepAlive set to ...

Linq to SQL EntitySet Binding the MVVM way

Hi everybody! In a WPF application i'm using LINQ to SQL classes (created by SQL Metal, thus implementing POCOs). Let's assume i have a table User and a Table Pictures. These pictures are actually created from one picture, the difference between them may be the size, coloring,... So every user may has more than one Pictures, so the a...

implement INotifyProperty changed on Static Property in WPF and Silverlight

The question is how to implement INotifyPropertyChanged on a static property because the event you implement is not static, and cannot be called by a static property. Also, you cannot bind to a static property in silverlight. I've seen this question pop up an a few forums with a variety of solutions, none of which were very satisfying. ...

C# source control that allows me to have multiple branches of code for various "editions"

Can someone recommend a source control product that does all of the following: Seamless integration into VS 2008 Pro Will allow me to create different "editions" of a program (like "express" and "pro") - maybe with branching? Will allow me to track changes for specific client requests. Say I have four clients, 2 on express, 2 on pro. I...

Why should I use WPF over Winforms? Any examples of WPF outperforming Winforms?

There is a similar question at http://stackoverflow.com/questions/202079/wpf-versus-winforms which has some good information but in my personal experience I see no reason to use WPF over Winforms. With WPF initially there was lots of talk about it's multi-threaded functionality but in use I see no benefits. I have two applications that ...

Simple Event Handling in MVVM

Just wondering what people had for ideas on how best to handle events in a ViewModel from controls on a View ... in the most lightweight way possible. Example: <MediaElement MediaOpened={Binding SomeEventHandler} /> In this case we want to handle the MediaOpened event in a ViewModel. Without a framework like Prism, how would on...

How to have image and button coloum in ListView in WPF

I have to add two columns in Listview , One columns show different images and another columns is used to show button. It will be great help if anybody provide the any link or example source code. Thanks in advance. ...

WPF: New Window in a TabItem?

Hey, Is it possible to open an other window in a TabControls TabItem? The reason i want to do this is that if i have 5 TabItems in my TabControl the one Window file im coding all these TabItems and their assosiated action will get very large. So it would be nice if it was possible to to give each TabItem its own Window file. Or how do...

WPF Listview databinding to generic List, dynamically filled by WCF service

In WPF app I have a WCF service which dynamically fills a generic List object from a backend database. How in this case (List created in runtime), I could bind List items to a ListView object items? It is the Data contract for my Web service: .... [DataContract] public class MeetList { [DataMember] public string MeetDate; ...

controlLibrary my.application dosnt working

Hello, I have built a Wpf-ControLibrary-Project to put some Controls there. In one Control i need to get some informations about assambly, Version and directory path. in the past i have done this one: Dim msg As String msg = "AssemblyName: " & My.Application.Info.AssemblyName & Environment.NewLine msg &= "Version: " & My.Application.I...

Exapander in WPF

I want to create an Expanders that will display different configurations.. like color settings , Mail settings. Let's say there are three expanders ...allign vertically. I want when expander collapse or expand it will shift the next expander. When expander collapse the lower expander will allign next to the uppermost expander.. Like ex...

How to get the size of the current screen in wpf

I know I can get the size of the primary screen by using System.Windows.SystemParameters.PrimaryScreenWidth; System.Windows.SystemParameters.PrimaryScreenHeight; But how do I get the size of the current screen ? (Multi-Screen users do not always use the primary screen and not all screens are using the same resolution, right ?) Nice wo...

Check if ObservableCollection is valid

I have a WPF Dev Express DxGrid that is bound to an ObservableCollection in the following way. Private _FamilyList As New ObservableCollection(Of FamilyRecord) MyGrid.DataSource = _FamilyList When a user starts to enter information in the grid, I need to be able to check whether they have missed some information making it Invalid. So...

WPF Blend like UIs using DOCKY - some errors...

Hello. Im trying to use Marlon Grech's "Blend like UIs using DOCKY", located at http://marlongrech.wordpress.com/2008/01/29/create-blend-like-uis-using-docky/ and i get some erros like: Error 13 'XSoftArt.WPFengine.FrameworkElement' does not contain a definition for 'IsLoaded' and no extension method 'IsLoaded' accepting a first argum...