wpf

Disable Alt+F4 in UserControl

Hello, i have some user control and i want to disable Alt+F4 oportunity for the end user. When my User Control shows, there is opportunity to close it with Alt+F4, then program goes to base class in the method: protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //Content = null; // Remove child from lo...

How to bind non-existing IsEmpty property of listbox?

Hello, I have a form and a button should be enabled only if the listbox is not empty. How can I do binding for this case? Note: I would like to avoid creating custom converter. Thanks! ...

Silverlight treeview. Cannot bind "IsExpanded" property

I have treeview control and i want bind tree nodes IsExpanded property to my datasource items! But i have exception: System.Windows.Markup.XamlParseException occurred Message=Set property '' threw an exception. StackTrace: at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Silverlig...

WPF simple binding problem

Hi Trying to understand this binding process of the WPF. See the code at the bottom. In my "viewmodel", see the code at the bottom, i have an observable collection that is populating the listview with the items. Thats the one that contains a path called symbol to set the selected index in the combobox. Now my problem is that i need to...

binding EntitySet to DataGrid in WPF

hi there Whats the ideal way to bind a EntitySet to a DataGrid? I use VS2010 and the .NET 4.0 Framework. The item in the class bound to the DataContext of my form does have the following property: public EntitySet<MyObject> objectsToBind { get { return context.MyObjects; } set { context.MyObjects= value; } } Any help or hints gr...

mvvm how to make a list view auto scroll to a new Item in a list view

I am using the MVVM pattern, I have a view which creates a new ViewModel, after the user clicks save, this view is closed and a seperate view is opened which Displays a collection of view models in a list view. This list view is sorted in alphabetical order, so the new ViewModel may appear at the bottom of the listbox, which is not imme...

Is the WPF Matrix3D.Rotate() function innacurate?

I'm currently trying to wrap my head around WPF, and I'm at the stage of converting between coordinate spaces with Matrix3D structures. After realising WPF has differences between Point3D and Vector3D (thats two hours I'll never get back...) I can get a translation matrix set up. I'm now trying to introduce a rotation matrix, but it see...

What are the main friction points when moving from WPF to Silverlight and how do you fill the gaps in functionality?

Okay, to give a little background, I learned WPF about 3 years ago and have kept reasonably up to date with what's happened since in various different versions. I looked at (and implemented) MVVM on a couple of projects, had a good look at frameworks like Prism so I think I'm pretty well versed in most areas of the framework. I've also...

"Resource with the name {Locator} cannot be found" Error when using mvvm-light user control

Hello everybody, i am using the mvvm light toolkit to create a WPF application. I created a user control and a corresponding ViewModel. I created a ViewModel property in the ViewModelLocator. I bound the user controls datacontext to the property in the Locator class. When i edit the User Control in Blend or the VS Designer everything se...

WPF ListBoxItem animating between Selection / MouseOver states

Hi, I have a ControlTemplate for my ListBoxItems and i want to animate between 4 different colors for the 4 Possible states of the Properties IsSelected and IsMouseOver. I have tried this using a MultiTrigger like this (IconBorder is a border surrounding the ListBoxItems <MultiTrigger> ...

How to? WPF Window - Maximized, No Resize/Move

Hi guys, I'm trying to make a WPF window that opens already maximized, with no resize/move (in systemmenu, nor in border). It should be maximized all the time, except when the user minimize it. I tried to put WindowState="Maximized" and ResizeMode="CanMinimize", but when window opens, it covers the task bar (i don't want it). I have a...

Is it possible to re-show and closed dialog window?

Some context here...I have a System.Windows.Window that is used to display a modal message box. I created a Show() method that initializes the content of the window, and then calls ShowDialog(). The user clicks a button on this window, some information about the clicked button is set in the Tag property, and then the window is closed via...

WPF: How to make a base class' dependency property read-only_

I have a class public class NavigableViewport3D : Viewport3D. The class should hide the the Viewport3D.Camera property, so that it becomes read-only. Here's what I have so far: public class NavigableViewport3D : Viewport3D { protected static readonly DependencyPropertyKey CameraPropertyKey = DependencyProperty.RegisterReadOnly( ...

WPF canvas zoom and rendering

Hi Guys, I am trying to place a canvas within a control which I will then use a Layout transform to implement zooming functionality. The problem is that while enlarging the canvas is easy, cropping the required section is proving difficult. I think it boils down to the following example code: <Canvas HorizontalAlignment="Center" ...

Using Expression Blend Interactions in ItemsControl

I'm trying to make a model editor (UML) in WPF, a bit of practice to get comfortable with WPF development. I'm kind of stuck however. I want to be able to drag and drop my components on the canvas, which I got working when I added a single item to the canvas. However, obviously I need to have more than one item on my canvas. This would b...

window.Owner (behavior expected)

what am I missing having this code behind on a XAML window // Create a window and make this window its owner Window ownedWindow = new Window(); ownedWindow.Owner = this; ownedWindow.ShowDialog(); I don't see the behavior http://msdn.microsoft.com/en-us/library/system.windows.window.owner.aspx Once this relationship is established, the...

Elegant handling of a Collection Change that requires changes on the dispatcher thread.

Here's my situation: I've got a User interface ItemsControl "ResultsPresenter" (WPF) pulling from a ListCollectionView that uses a BindingList "Results" from a non-UserInterface class as the ListCollectionView.Source property. Whenever I make a change to "Results" such as an add operation, I get a NotSupportedException, insisting tha...

WPF - slow service init connection

Hi, I am developing a small WPF application which is using web service. The web service is only available for internal users and they have to be logged in to their machines to be able to use it - it is using windows credentials. Everything works well except the connection speed. It takes around 10 sec to initiate the connection and do...

Recommend best approach in this situation.

I'm experimenting with MVVM and I can't quite wrap my mind around it. I have a View (windows) that has several repeated controls. Let's say I have 4 textbox - button pairs. Their behavior should be the same, after pressing a button paired textbox says "Hello World!" I have tried several options I could think of: One ViewModel, 4 st...

Animated WPF Menu

if i have something like that: <StackPanel Orientation="Horizontal"> <TextBlock Text="FIRST" Margin="5" VerticalAlignment="Center" /> <TextBlock Text="SECOND" Margin="5" VerticalAlignment="Center" /> <TextBlock Text="THIRD" Margin="5" VerticalAlignment="Center" /> <TextBlock Text="FOURTH" Margin="5" Vertica...