wpf

.NET Framework updater component and WPF

Hello Good people, I'm trying to do add an auto-updater to a wpf application of mine and liked this article and i've tried to add the updater component to the toolbox of the VS 2008 that i'm using but it seems it cannot be added to the wpf project toolbox.I doubt i would see it the wpf project toolbox even though i added it from winfor...

Is Behaviour supported on wpf in 3.5? I cannot see System.Windows.Interactivity in VS2010

Is Behaviour supported on wpf in 3.5? I cannot see System.Windows.Interactivity in VS2010 ...

WPF custom control problem

I have a problem, and I have not found the solution yet. I woud like to create a base custom control and use it in another custom control. The base control works fine when I use it in a window, but when I use it in the other custom control, the binding does not work. What's wrong with my code? Code: Model: public class ElementModel {...

How can I anchor a textbox in wpf ?

I have a window with tabs. On one of the tabs, I have a layout like below. (In fact it is more complicated, I have 4 text boxes in a row, and I have more rows.) How can I make the 3rd textbox have the width of the label + the width of the text box above, that is, to have them properly aligned ? The problem is that WPF widens the 3rd text...

How can I scale multiple windows with fixed aspect ratio so that they cover maximum of monitor without overlapping

My question is in my title. I am trying to develop a logic so that I can scale fixed aspect ratio windows to cover most of the screen without overlapping eachother. There could be two three or four windows. There could be an alignment parameter also. ...

WPF Sizing of Panels

I'm looking for an article or overview of WPF Panel types, that explains the sizing characters of each. For example, here are the panel types: http://msdn.microsoft.com/en-us/library/ms754152.aspx#Panels_derived_elements I've learned (by experiment) that UniformGrid can be given a fixed height, or it can be "auto" where it expands to ...

How do I swallow the dropdown behavior inside an Expander.Header?

Hello, I would like to prevent an Expander from expanding/collapsing when users click inside the header area. This is basically the same question as Q 1396153, but I'd appreciate a more favorable answer :) Is there a non-invasive way to do this? I am not sure exactly how to attach behavior to the Expander.Header content to prevent mous...

How do I work with WIndows Forms in WPF?

How do I work with WIndows Forms in WPF? In my WPF program I created a Windows Form class. In this Form, I placed an OK button and I went into the properties of the button and set the DialogResult to OK. Now, I am calling this Dialog (Window Form) from the MainWindow.xaml.cs: DialogResult dres; dres = form.ShowDialog(); ...

How can I bind another DependencyProperty to the IsChecked Property of a CheckBox?

Here's an example of what I'm trying to accomplish: <Window x:Class="CheckBoxBinding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel> <CheckBox Name="myCheckBox">this</CheckBox> ...

Why won't WPF databindings show text when ToString() has a collaborating object?

In a simple form, I bind to a number of different objects -- some go in listboxes; some in textblocks. A couple of these objects have collaborating objects upon which the ToString() method calls when doing its work -- typically a formatter of some kind. When I step through the code I see that when the databinding is being set up, To...

WPF Canvas - Single Pixel Grid

Hi guys, I have a custom WPF Canvas, upon which I would like to show a grid. I do so by overriding the OnRender method on Canvas, and using the DrawingContext drawing functions. IsGridVisible, GridWidth, GridHeight are the number of pixels between each grid line horizontally and vertically respectively. I also use a ScaleTransform on t...

Bind to Count of items in the DataContext

I want to bind to the Count/amount of items within my DataContext. I have an object, lets say person which has a List<address> as a property. I would like to display the amount of addresses for that person ie: 5 or 6 or whatever the case may be. I've tried {Binding Path=address#.Count} and a few others but that doesnt seem to work. A...

How do I MVVM-ize this MouseDown code in my WPF 3D app?

In my view, I have: <UserControl x:Class ... MouseDown="UserControl_MouseDown"> <Viewport3D Name="Viewport" Grid.Column="0"> ... </Viewport3D > </UserControl> In my code-behind, I have: private void UserControl_MouseDown(object sender, MouseButtonEventArgs e) { ((MapPanelViewModel)DataContext).OnMouseDown(e, View...

Can't access resource from Generic.xaml within the Custom Control constructor.

I'm not sure why this is doing this, but I can't access the resource from within my constructor. XTabItem.cs using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MyStuff { public class XTabItem : TabItem { public static readonly Dependency...

Silverlight/WPF: Retreiving the size of a UIElement once it has been rendered on screen

I have the following simple piece of code: var canvas = new Canvas(); foreach (var ztring in strings) { var textblock = new TextBlock(); textblock.Text = ztring; panel.Children.Add(textblock); textblock.Measure(infinite...

is there a Megaupload API out there?

I want to do my own manager... and want to know if there is something to develop it faster... thanks in advance. ...

Binding across multiple DispatcherObjects

Here is a really tricky scenario I have been confronted with. I have a static helper class that contains some dependency properties used as binding sources. My main Window binds to these properties to determine some visual aspects. Recently we have added the ability to measure the progress of long-running operations with a progress bar w...

Silverlight databinding error

I found an example online that explains how to perform databinding to a ListBox control using LINQ in WPF. The example works fine but when I replicate the same code in Silverlight it doesn't work. Is there a fundamental difference between Silverlight and WPF that I'm not aware of? Here is an Example of the XAML: <ListBox x:Name="list...

WPF Books in 2010

I'm looking to learn WPF, and I'd like to get a book to help in the process. Most of the popular questions on SO regarding actual books are from 2008, and I wanted to see if recommendations for books had changed at all. WPF Unleashed, which seems to be the most popular recommendation, was published in 2006, which is quite a while ago, w...

WPF binding behaviour different when bound property is declared as interface vs class type?

This started with weird behaviour that I thought was tied to my implementation of ToString(), and I asked this question: http://stackoverflow.com/questions/2916068/why-wont-wpf-databindings-show-text-when-tostring-has-a-collaborating-object It turns out to have nothing to do with collaborators and is reproducible. When I bind Label.Con...