wpf

What is causing the error 'Must specifiy both property and value for setter'?

I have a style which toggles the visibility of an image depending on an underlying DataContext property. Unfortunately I keep getting an error: 'Must specify both property and value for setter' The XAML looks like <Style TargetType="{x:Type igDP:LabelPresenter}" x:Key="BuySellLabelStyle"> <Setter Property="Template"> ...

Tool for automated testing of WPF Application

I am looking for an automated testing tool for our WPF application. I've tried QTP and am not interested in its price. I am looking for a lower priced solution with some good reviews. Thanks. ...

WPF Close UserControl in Frame and access Parent Controls

I have a WPF app with a Window (RootWindow) with a Toolbar and a Frame (ContentFrame). Initially the Toolbar is hidden. I load a Login UserControl into the Frame and when the user correctly logs in I'd like to close the UserControl and then make the Parent Window toolbar visible. Seems such a simple thing to do. However, you cannot cl...

[WPF] binding another control in DataTemplate

I'd like to show the PixelWidth & PixelHeight of the image (not thumbnail) in tooltip, But I have not idea how to do binding in the datetemplate, I try to use "{Binding ElementName=imgPreview, Path=Source.PixelWidth}"/>, but got nothing. Could anyone explain how to do it? <ListBox.ItemTemplate> <DataTemplate> ...

Which files have to be in SVN repository for other people to be able to compile?

I've created a Codeplex site for an app I'm building and right now I just right click the entire solution folder Visual C# Express created for me, and used that. Now in my repo I have a lot files that I'm assuming will enable the user to compile my application on their end. I heard I shouldn't upload the /obj folder and some other thin...

AvalonDock autohide to side of pane instead of window

I have the following AvalonDock XAML: <ad:DockingManager Name="DockManager" Background="White"> <ad:ResizingPanel Orientation="Horizontal"> <ad:DockablePane ad:ResizingPanel.ResizeWidth="300" Name="LeftSideBar" SelectedIndex="0"> <ad:DockableContent Name="Connection" Title="Connection" IsCloseable="False"> ...

databinding a Dataset to a listbox...Datatemplate needs to display from multiple columns

Hi, I was trying to figure this out for quite some time.I want a Databind a listbox with a Dataset.Simple as it can get.But my problem is that i want my datatemplate to display Columns from two tables,in the dataset.I have tried many samles..but everything i found just gives the dataset as datacontext and gives a single table as itemsour...

Limit panning only to visible image area in Silverlight MultiScaleImage

Silverlight experts out there, I need some help. I used Deep Zoom Composer to generate the Silverlight application for a large map image(20MB+) for a client. But the client does not want the people to pan to the black areas that are out of the bounds of the image in the MultiScaleImage. How can i do that? Thanks! ...

WPF Observablecollection master detail scenario

Hi, any help with this would be great. I have a model public class Master { ... public Detail[] Details {get; set;} } I am populating my view model from a WCF service which returns my collection of Master objects. I have configured the service reference to return observablecollection so I can use it easily in my view model. M...

Convert dataset to observable collection

hi, I was trying to bind a dataset to a listbox..certainly because i want to display a couple of tables information in a datatemplate..But this seems not possible and i will have to convert it to an observable collection.But how can i do it.My bl returns dataset objects.How can i convert this to observablecollection..? Is there any way s...

Align items in a stack panel?

I was wondering if I can have 2 controls in a horizontal-oriented StackPanel so that the right item should be docked to the right side of the StackPanel. I tried the following but it didn't work: <StackPanel Orientation="Horizontal"> <TextBlock>Left</TextBlock> <Button Width="30" HorizontalAlignment="Right">Right<Button> </Stac...

<ContentControl>Content</ContentControl> vs. <ContentControl Content="Content"/>

Given the following two options: <ContentControl>Content</ContentControl> vs. <ContentControl Content="Content"/> Any performance differences? What would you say is more readable? Conclusion? I'm affraid this question might sound somehow babyish, but how will I know if I won't ask, so I decided to shoot it. Comment me if I chose...

Where is the Shape located on Canvas ?

Hi, Say I put a Shape on a Canvas like this: Canvas.SetLeft(myShape, 50); Canvas.SetTop(myShape, 30); canvas.Children.Add(myShape); After that, myShape was drag & dropped on this Canvas. How can I determine the current myShape coordinates ? For example, before the drag & drop I would like to get (50,30). Thanks ! ...

WPF ListBox as RadioButtonList - mimic SelectionChanging Event via WPF validation

I am using ListBox for having RadioButtonList behaviour (that's what people recommend as there is no inherent radio button list in WPF). The listbox is bound to a ViewModel. Now, whenever user changes the selection on listbox, I want to check whether user has some unsaved data on the part of screen and prompt accordingly (typical yes,no...

How do I override ToString() for a Dictionary

I have a Dictionary<string, FieldDefinition> dependency property that when I bind it to a WPF list box I want it to just print the string (not the FieldDefinition). Is there a way to do that? ...

Unable to implement ICommandSource in VB

Hello! Has anyone ever tried to implement ICommandSource with VB? The examples provided by Microsoft are in C#, and since VB doesn't allow implicit implementation this interface is like inachievable in VB!! http://msdn.microsoft.com/en-us/library/ms771361.aspx ...

Treeview databinding to a DataTable

Hi, I am new to WPF and would really appreciate help on an issue Im struggling with. I need to Bind a treeview Item in a WPF treeview in the main app's Menu. All i need is the correct syntax to bind the single datatable to treeview item(XAML and the codebehind) this is what I have so far. Please provide code with your suggestion, y...

Load Image from Xaml

HI all! I am wondering that could I load a image from xaml file? I mean that, for example: I have a folder IMAGES that contains all of my images.These images were not added to my project.At an xaml file I try to load an image.like bellow code: <Image Source="/IMAGES/gift.png" Height="70" Width="70" VerticalAlignment="Top" /> Could I ...

How do you get the selected text of a WPF FlowDocument?

I'm using .NET 3.5 I have a FlowDocument inside a FlowDocumentScrollViewer. I am not using RichTextBox. The FlowDocument comes with a number of "freebies", including text selection and a context menu for copy/paste. How can I find out what text is currently selected in the FlowDocument? I imagine that I could use ApplicationCommands...

Visual Studio Hangs in WPF Design View - ".NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A2E0F92) (0)"

I've encountered an issue where Visual Studio hangs in WPF design view. I've read through similar posts and I believe my issue is similar, but different. The errors I see in Windows Event Viewer are below. Hanging application devenv.exe, version 9.0.30729.1, hang module hungapp, version 0.0.0.0, hang address 0x00000000. .N...