wpf

Animate ListBoxItem after pressing a button within DataTemplate

I have a ListBox with a DataTemplate for items. The DataTemplate contains a button. How do I rotate the UIElement represented by the DataTemplate when the button gets pressed? Any help greatly appreciated. ...

Questions regarding How do i tutorial (WPF/Entity Framework/ObservableCollections)

i watched How Do I: Build a WPF Data Entry Form Using Entity Framework? very confused around 15:30. when the presenter said something like when you create a LINQ query, we wont get a rich collection ... whats does she mean my "rich". the start code looks like... whats wrong with that. even if i change db.Customers.Execute(...) ...

Nservicebus configuration in WPF

Using the pub/sub sample i managed to get multiple instances of the same console app to read all messages sent from the publisher. What I did whas this: namespace Subscriber1 { public class EndpointConfig : IConfigureThisEndpoint, AsA_Server { } public class OverrideInputQueue : IWantCustomInitialization { public void...

WPF Ribbon - Auto Collapse when Height is Less than 250

Salam, Can any one help me please with the WPF Ribbon, I noticed that when you give the window that contains the ribbon control height less than 250 the ribbon auto collapse. after it auto collapses if you explicitly set it's visibility to Visible only the title bar is shown without the tabs. Any means to stop this behavior? ...

Any default converters for WPF?

i read that i can use data converters in binding like ... <TextBlock Text="{Binding Converter={StaticResource PositionConverter}}" /> from here but i wonder if there are any "in-built" converters. because creating converters to just output say 2 decimal places etc seem troublesome. i just thought that there must be sometime inbuilt t...

Image.Source in new window

There are several Image. Pressing the Image opens. How do I pass this window image, which I clicked? image1.Source = new BitmapImage(new Uri(); ... imageN.Source = new BitmapImage(new Uri(); private void ShowPreview(object sender, System.Windows.Input.MouseButtonEventArgs e) { PopupWnd ww=new PopupWnd(); w...

WPF Style trigger problem

I want to write a Style for a Border element when its pressed. But doesn't have IsPressed property. So how can I set style for this scenario. Please help. ...

Static verification of bindings

Or "how do you make sure all your bindings stay correct?" (this is kinda lengthy, but bear with me, I tried to make it as short as I could) Consider the following example: <TextBox Name="tb" /> <TextBlock Text="{Binding Text.TheProp, ElementName=tb}" /> It is perfectly known at compile time that the binding is incorrect (i.e....

Not all ListBoxItem are created equal.

Hello Everyone, In the example below, the DataTemplate only gets applied to the first and second list item, the third and fourth are completely ignored. <ListBox> <ListBox.ItemTemplate> <DataTemplate> <Button Content="{Binding}"></Button> </DataTemplate> </ListBox.ItemTemplate> <sys:String>One</s...

Nested ListBox Sizing problem

Guys, I need your help! :-) Check out this code example: <ListBox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="500"> <ListBox x:Name="Item1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="300" BorderBrush="Red" BorderThickness="5"> <ListBox.Items> <RichText...

Move a rectangle around a canvas

I have a canvas in the middle of my application with controls around it. I have a socket that recieves Points and saves them in a list. I draw small 4x4 rectangles on the canvas for the number of points in my list.. say theres 4 points.. theres 4 rectangles. I want to be able to move the rectangles when the points change with code. is ...

Custom WPF EndLineCap, StartLineCap & LineJoin or new attached properties

Just wondering if anyone knows how I would implement additional/custom EndLineCap, StartLineCap & LineJoin attributes? In short, LineJoin="Round" is what I want but I need both sides of the angle are smooth - instead of just the wider angled side. Also, instead of just Rounded EndLineCap and StartLineCap I want a ball on each end (for...

Problem setting Foreground with Visual State Manager

I have a WPF application, and I am attempting to style a TextBox using the .Net v4 Visual State Manager. Specifically, I am attempting to set the colors of the Foreground and Background for the MouseOver state. What is happening is that, while the background and border are changing perfectly, the foreground is not. If the brushes that...

WPF C# - Using Xaml to load folder of images

Hello, In my on going quest to learn C#, both winforms and WPF, I have whipped up a program similar to visio in WPF. Its using the new WPF ribbon control, and am using a expander to hold some basic shapes that can be made in Xaml(ie. Ellipse), and the shapes are stored in a 'shapebox' that the shapes can later be dragged onto the form a...

Generate Entitities in separate folder

Like you can see on the image http://i51.tinypic.com/xoe14j.jpg I have an Folder Server with the VDB.Data Class Library. In that class library i have my VDB edmx. But i wonna have my generated entities in een other folder. They must come in the Common Folder under the VDB.Common.Model --> Entities --> Generated In the edmx are Custome...

WPF control size is larger than explicitly set width and height values.

I created a Canvas with fixed Width and Height (256x256). Next to it I put an Image control displaying a 256x256 texture without stretching. How is it possible that actual sizes of both controls on the screen differ so much? Here - is the screenshot illustrating size mismatch. And here - the TestLines256.png in case someone liked to ch...

WPF TabControl SelectedItem is reset after window has been closed

I have a problem with the selected item in WPF-TabControl that could be reproduced with the following simplified code: If a new TabItem is created and selected through the Click-event of the button in the second window, the tab is created, added and selected. When the second window will be closed, the selected item of the tab-control is...

[WPF] Updating a 2nd window control from events in an object created in the 1st window

Hi, here's what I need (it's a bit hard to explain): I have 2 window controls: MainWindow and FileMover and 1 util class: FileMonitor MainWindow created a new object of FileMonitor for testing purposes on it's Loaded event, which creates a FileSystemWatcher and a Timer object. The FileSystemWatcher watches a given folder for Created an...

How can I determine coordinates of a Hyperlink in WPF

I have WPF window with a FlowDocument with several hyperlinks in it: <FlowDocumentScrollViewer> <FlowDocument TextAlignment="Left" > <Paragraph>Some text here <Hyperlink Click="Hyperlink_Click">open form</Hyperlink> </Paragraph> </FlowDocument> </FlowDocumentScrollViewer> In the C# code I handle Click e...

Show form when exception occurs C#

Hi, I have been looking at the Windows API Code Pack 1.1 and have seen a Error sample and would like to integrate it into my Application, the main idea would be for it to show if any error in the application happens, well not any but some that I choose. How can I program this? I am using WPF Thanks ...