wpf

WPF Properties.Settings throws exception on launch and close

When my Wpf app starts up I get a BindingFailureException in Settings.Designer.cs [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public global::System.Collections.Specialized.StringCollection Projects { get { return ((global::System.Coll...

Check for InvalidOperationException from '[Unknown]' property does not point to a DependencyObject in path

Hi all. This is just a quick, low-priority question seeing as it doesn't effect the way the application runs, just throws some unsightly errors that I'd like to get rid of. I have a storyboard sets up via the SetTargetProperty method and when all my paths are setup. The question here doesn't refer to debugging this part or anything like...

WPF DataTemplate performance

Well the problem here is that if you have one DataTemplate for a type of object, each time the object is present, the DataTemplate will be created, that sounds about right. My problem is that our DataTemplate is sort of heavy AND the app could have around 1000 objects using that DataTemplate. I created a simplistic example where I crea...

display Hourglass when application is busy

For a view constructed using WPF, I want to change the mouse cursor to a hourglass when the application is busy and nonresponsive. One solution is to add this.Cursor = Cursors.Wait; to all the places that may cause the UI to become non-responsive. But obviously this is not the best solution. I am wondering what is the best way to ...

Render XAML with remote images

I'm working on a tool that renders pieces of XAML to images.The XAML is used as a template to design the images. Due to the way the rendering works it is not possible to use a codebehind. Rendering just xaml is no problem. In one of my templates I want to give the renderer a lat/long and include an image from google maps, among other i...

WPF: How to pass whole Control as CommandParameter via XAML?

Hi I'm using MVVM and custom ICommand objects are provided by ViewModel layer. One ViewModel object at the same time can be attached via DataContext property to many View objects (windows, pages, etc). In ICommand.CanExecute() I want to check absence of validation errors for some controls in View (which attached to ViewModel props, sign...

Popout window issue for WPF

Now, I got a Installation Window, which have a cancel button to 1) pause the storyboarding 2) popout my Cancel Window For Cancel Window, there will be an "OK" button for me to be prompted to Failed Window. So now I want to know how to track when the User closes the window (X) button, so I can close the Cancel Window and thus returning ...

WPF chessboard - how to draw in XAML

I need to draw a chessboard in WPF. I'm new in WPF and writing some working code in XAML is quite complicated for me. So far I read that I should probably use a TileBrush however I don't really know how to use it. I also read that some people draw boards using UniformGrid, however I don't know how to fill in the grid's cells in the prop...

Wpf inkcanvas Save and Retrive text

Hi i am trying to implement a mspaint like application in wpf.I have successfully implemented most of the basic drawing functionalities by implementing a custom stroke class.Now i am trying to implement the Text inserting option from mspaint.I have tried to implement using DrawingContext.DrawText,it is working alright but when i save the...

WPF custom shape control

Hi I was wondering if it is possible to make a custom shape custom control. I need to make control which contains textbox, however the control must have a shape of triangle or sth more sophisticated than regular rectangle/square. ...

How to align button on wpf treeview

Hi i am looking for a way to align the buttons in my treeview so that it will look like in the same column even if it is in any level. Eg: Item1 [Button] Item2 [Button] Item3[Button] i want it to look like Item1 [Button] Item2 [Button] Item3 [Button] Any way that i can do this..? Please help ...

WPF Initial Delay on RepeatButton

How can I set an initial delay on a RepeatButton(before first click event is fired) when ClickMode is 'Hover' ? ...

WPF DataGrid Dynamic Styling

Hi, I have a DataGrid control in a WPF application. I want to be able to at runtime, select a value from a combo box, click a button and highlight the background color of all rows that meet this condition within the DataGrid. This was pretty easy to do in Windows Forms in the code behind, but I can not figure it out in WPF. Any hel...

How do I track all instances of a DataTemplate, or a control within a DataTemplate?

I'm using a DataTemplate to apply a View to a ViewModel. I have a case where when a certain thing happens in one instance of the View (DataTemplate), I need to take an action in all other instances. I'm already accomplishing this by implementing the Initialized event on one of the controls in the DataTemplate, and using that event to a...

textbox - textbinding in WPF

Hi Let's say that I have a custom WPF control and couple of textboxes on it. In code behind of my custom control I have couple of properties which are references to objects in other control. For example I have a sth like this public MyClass myObject { get { return MyObject } } MyClass have ...

WPF: what object to use as a multi-cell grid which coordinates can be read from?

I need to create the following WPF application: A main window with a square grid in it. The grid should have a large amount of cells in it (for example: [1000x1000]), each cell being painted black or white. A "Robot" object should be able to walk on the grid from cell to cell. I thought of using a Uniformgrid object, but I suspect th...

wpf drag over design question.

Hi, I have a user control. When the user drags over items onto it, I need to present him with 2 options, depending on his choice I need to proceed with the next step, I could sho him the option after he drops the items, but this will involve an extra click on the user part, I was wondering if there are any techniques in wpf or ways to sh...

WPF - runtime updated binding question

Hello everyone! I'm quite a novice with C# and a complete newbie regarding WPF. Probably it's a very basic question and piece of cake for the pros. Please bear with me. I need to display a dynamic textblock with text changed in run time without additional triggers such as button clicks and so. For some reason (my insufficient understand...

How do I pass information from a ThreadPool.QueueUserWorkItem back to the UI thread?

I have a rather simple threading question. I'm writing a simple utility that will run various SQL scripts based on parameters defined by the user. In order to keep the UI responsive and provide feedback as to the status of the scripts that are being executed, I've decided that using ThreadPool.QueueUserWorkItem would be appropriate to ...

How to layout controls in the top right hand corner in XAML/Silverlight?

I am going through the process of designing my first Silverlight application based upon the PivotViewer control from Silverlight 4. I am having problems organizing the bar at the top as per my design: I have found ways of left aligning the Logo and Title, a way of right aligning the buttons with various combinations of panels however ...