wpf

XmlnsDefinition for recursive namespaces

Hi all, i have a project that is structured with a .net namespace called ViewParts. This, on the other hand, consists of many different subfolder with wpf usercontrols in them. I have added an XmlnsDefinition attribute to my AssemblyInfo.cs file to map that .net namespace to a uri for use in other window/usercontrol files. But i would r...

Changing focus in xaml

Greetings, I have a problem changing the focus to some button on xaml. The code I am attemps to do it looks as follows (if some conditions are fulfilled then the focus should be set to the button. The strange is that for test purposes I'm also chaning the background of the button and this property is set each time the conditions are fu...

WPF: Binding Customized ListBox & List<T>: PropertyChanged is always null

Hello all, i have customized ListBox declared in XAML: <ListBox x:Name="uicMDSQonfServer"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Margin="0,5,0,5"> <CheckBox IsChecked="{Binding RelativeSource={TemplatedParent}, Path=Activated...

WPF, debugging databinding

Hi there I'm trying to understand the following part of an error message: Additional information: 'Provide value on 'System.Windows.DynamicResourceExtension' threw an exception.' Line number '118' and line position '56'. , what lines are the error referring to? No source files are mentioned.. ...

WPF 4 touch events getting the center of a pinch gesture

Hi All, I am using the .net 4 beta 2 touch libraries, and Im trying to implement a zooming feature in my WPF application. I can get the zooming working just fine, but what I want is to zoom in on the center of the pinch gesture, and I cannot see anything in the API's about how to accomplish this. Is there some methods or properties t...

Displaying warnings in a similar way to errors on a wpf control

I would like to display warnings and errors when validating a business object and have these displayed visually to the user. For example I have a business object class implementing an interface like so: interface IOrderItem : IDataErrorInfo { int ProductId { get; set; } string ProductName { get; set; } decimal Price { get; set; }...

WPF : Reorder WrapPanel content via drag and drop?

I am looking for a way to reorder the content (items) of a WPF WrapPanel via drag and drop. I just want to click on an item and drag it to a new position. To my understanding this is a very common task and I wonder I someone already did this or has any idea how to implement this functionality. I did a google search already but found no...

System.executionengineexception in wpf

Dim lPropertyInfo As PropertyInfo Dim lSecondLevelPropertyInfo As PropertyInfo Dim lPropertyValue As String = String.Empty Dim lSecondLevelPropertyValue As String = String.Empty Dim lMainParagraph As Paragraph Dim lSubParagraph As Paragraph Dim lFormatAvailable 'As CustomStyle Dim lCollection As New Collection(Of String) ...

The best approach to create new window in WPF using MVVM

In the neighbour post: http://stackoverflow.com/questions/501886/wpf-mvvm-newbie-how-should-the-viewmodel-close-the-form/2100824#2100824 I've posted my vision how to close windows with MVVM usage. And now I have a question: how to open them. I have a main window (main view). If user clicks on the "Show" button then "Demo" window (modal ...

How to resolve communication between my WPF application and a hosted IExplorer?

Hi, For a rather large project i have to figure out how (if possible) to resolve this problem. I have a full screen WPF application doing a slideshow - following an interval of e.g. 20 secs per slide. Now I have to investigate into the possibility of replacing the slideshow with a URL instead and have the user navigate the slides instead...

Wpf Richtextbox clear error

Dear Friends, When I run this code, I get the following error .. system.Executionengineexception. Can anyone guide me as to what I might be doing wrong? Thanks Dim lMainParagraph As Paragraph Dim lDelimiter As String = String.Empty Try For x As Integer = 0 To 1 lMainParagraph = New Paragraph ...

Overriding default key behaviour in a TextBox

I've just implemented a quick autocomplete feature in a textbox that pulls a string out of a fairly small list and "completes" the word. The TextBox caret stays at the location it was in from the last keypress, and the part of the word that the user has yet to type becomes highlighted, such that beginning to type something else will remo...

Databinding in style to property on parent window

Hi, Is it possible to declare a style that sets the fontsize of tooltips to the same size as the parent form? I have tried this... <Style TargetType="{x:Type ToolTip}"> <Setter Property="FontSize" Value="{Binding ElementName=MainWindow, Path=FontSize}"/> </Style> ...but that doesnt work. Any suggestions? ...

How to get Color from Hex color code using .NET?

How can I get Color from a Hex color code(e.g. #FFDFD991)? I am reading a file and getting Hex color code, I need to create the corresponding System.Windows.Media.Color instance for the Hex color code. Is there any inbuilt method in framework to do this? ...

WPF C# Client/Server announcement system

I'm currently in the process of creating an announcement system at my place of work. The role of this system will be to replace all users email due to people misusing it and generally abusing the facility. The system will consist of: Web Portal: Will allow staff to enter any important announcements (this will be restricted via AD). SQ...

WPF Binding to properties of an object with specific attributes

I have a listbox to which I have bound the data context to an object. This object has a number of properties some of which will have a particular attribute. What I want to do from this is to have the items source set to the properties of the object but to only display those properties that have a particular attribute set. Can anyone he...

WPF GroupBox with no header space

Hi, Easy one, I would like to have a GroupBox with no header space The closest thing is a border, but the border "by default" does not have the same Style as the group box. What's the easiest way (least xaml / code) to get the desired GroupBox ? Thanks ...

WPF storyboard animation issue when using VisualBrush

Hey guys, I was playing around with storyboards, a flipping animation, and visual brushes. I have encountered an issue though. Below is the xaml and code-behind of a small sample I quickly put together to try to demonstrate the problem. When you first start the app, you are presented with a red square and two buttons. If you click th...

Binding: WPF vs WinForms

As far as I know, INotifyPropertyChanges was "invented" before WPF. Could someone please explain what is new in WPF that allowed to do different kinds of binding properties of the control to the properties of objects. Either this was also available in the WinForms but wasn't so popular due to some reasons? (if yes, what is that reasons)...

How to forward value converter and converter argument from template parent?

I created a custom control called RegexTextBox which derives from TextBox. To this I added a Regex dependency property. All of this works fine. Next thing I created a NumericUpDown button control based upon the NumericUpDown in Kevin's WPF Bag-o-Tricks. I replaced the default TextBox with my RegexTextBox and added 3 more dependency prop...