wpf

HTML Rendering with C#

Let's say I'm crazy and I want to implement an basic HTML rendering engine with c#. I would like to use WPF Controls to display the HTML Layout. While there is nothing to gain with such an idea, I still want to try it out! So what libraries, projects and documentation would help me get this done? ...

Why is the BitmapImage a sealed class?

I was about to inherit from the BitmapImage class when I noticed it was sealed, I've had a quick look around but I can't find a reason it is sealed. Any body know why this is? Thanks ...

WPF contextmenu and ListView

Ok, hopefully this is simple but for some reason I can't find a straight answer and I'm not familiar enough with WPF yet to know how to do it. I have a listview, it gets bound to an observable collection of objects to display. I want to have a context menu with a bunch of options. The options in the context menu are relative to the part...

Update ListView's ItemsSource Constantly?

I have a ListView that I set it's ItemsSource to list all the Assignments (a table in my SQL Database, ORM is LINQ to SQL) like so: ltvAssignments.ItemsSource = _repo.ListAssignments(); (This bit of code is exactly after InitializeCompenent() is called) And for the heck of it, I added a sample: Assignment sample1 = new Assignment() ...

wpf databinding with a user control

I have a wpf user control, which exposes a single custom dependency property. Inside the user control, a textblock binds to the value of the dp. This databinding works in all scenarios except when the data source is an object. The minimal code necessary to reproduce this is: this is the main part of the user control <StackPanel O...

Rewriting a WPF application to Surface

I'm working on a WPF application, and I'm curious about what it would take to rewrite this application to a Surface application if we want to control it through multitouch some day. Is it likely that we can reuse big parts of our WPF application and transfer it smoothly to Surface, or is Surface completely different, and we probably ha...

Add a delay to OnContactDown events for Surface controls

We're using the Controls.PreviewContactDown, PreviewContactUp, and PreviewContactChanged events to capture tagged items being placed, removed, and moved on the Surface, which works great in the Simulator application that comes with the surface. On an actual Surface if you moved a tagged item too quickly the cameras actually lose focus ...

Can WPF apps be compiled to native code?

I know there are tools like Salamander that can compile a .NET WinForms apps to fully native code with no need for the CLR/.NET Framework to be on a machine. Is this possible for WPF apps as well? ...

WPF: Browser-like tear-outs

I have an application that consists of a set of tabs. Each tab has an indpenedent user-control. Currently the users can press a "New Window" button. This button creates a new form and moves the user control from it's current tab into the new form. Instead of the button, users would like to simply drag the tab out of the current window ...

How would I go about translating this method from Winforms to WPF?

Hi all, I have a simple program that creates a series of PNG images based on a range of numbers, ie; 1 through 10. I iterate through each number and create a png image of that number, in various sizes. Below is the void that I use to create the images. private void CreatePNG(int number, string location, int width, int height) {...

Silverlight or WPF for a little winforms/desktop type application?

Hi, I have a simple WinForms type application (main form, couple of sub-forms, minimize to system tray with notifications showing here). I was going to move to WPF however I'm hearing some people say go silverlight (out of browser). Question - Which way should I go for a simple desktop winforms type app? WPF or Silverlight? Tks ...

WPF contros in VC++

Hi, Im using WPF controls as C# dll in VC++.Im having Tabcontrol with three tab items.Two tabitems contains buttons only and third tab contains Listbox.Im sending data to Listbox from my VC++.So i did coding like this ref class Globals1 { public: static System::Windows::Interop::HwndSource^ gHwndSource; static Tabcontrol::Tool...

Pausing a Storyboard in WPF ?

I'm gonna pause a Storyboard in WPF, so I've used below code : Storyboard TheStoryboard; //Constructor public window { TheStoryboard = (Storyboard)this.FindResource("TheStoryboardName"); } private void MenuItemPause_Click(object sender, RoutedEventArgs e) { TheStoryboard.Pause(); } But nothing happen! What is the right way ...

LINQ to SQL datacontext update after changing SQL Server name

In a WPF application I use LINQ to SQL, SQL Server 2008. SQL Server computer was replaced and SQL Server was installed under instance name not the same as before. Database was restored under the same name as before. The new connection string was added to the application. But it appeared that it is impossible for the application to con...

how can i draw a line between two points on a grid in WPF

I have a grid with 100 columns and 100 rows. I want to draw a line between the centre of one of those grid squares and another, say 45,25 to 75,38. I am happy with being able to draw a line, but how can i find the x and y pos of the centre of the two grid squares? Or is there a better approach i have missed ...

Does the BackgroundWorker provide real multithreading?

Learning to build multithreading WPF applications I read about some restrictions in using BackgroundWorker that was not very clear for me. Please, help me to understand: If I want not only one thread working behind the scene of UI, but maybe several ones, starting and ending independently one from another, will the BackgroundWorker fit...

WPF, Entity framefork and validating models

Hello, I'm buidling an WPF application using the examples given in the link below as a basis: http://www.robbagby.com/silverlight/patterns-based-silverlight-development-part-ii-repository-and-validation/ In the example given, the uses the OnValidating partial method to invoke validation and if nessesary, throw an exception when someth...

Why is the WPF property IsDefaulted not found?

I was working on my button template with this example: http://msdn.microsoft.com/en-us/library/ms753328.aspx I found the "IsDefaulted" property quite useful, but can't use it. I have the following trigger setup: <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName...

Databinding to XML in a DataTrigger in WPF

In a WPF application, I have correctly bound a DataTemplate to an XML node that looks like: <answer answer="Tree", correct="false" score="10" /> In my application, I have a TextBlock with the answer in it. At first, I want it invisible, but when the correct attribute in the XML file changes to "true", it must become visible. My DataT...

Modifying an item in a WPF sorted ListView doesn't change the sort position of that item.

I have a sortable listview that gets filled with a live data as it comes. Sorting works perfectly but the real problem arises when an item is modified after being added to the collection. The position of modified item does not change no matter what the sort orders is. I have googled it but couldn't find a better solution to make my list...