xaml

Inheritance in Silverlight 2 Styles

I want to build up styles in XAML, e.g. <UserControl.Resources> <Style x:Key="MyStyle" TargetType="TextBlock"> <Setter Property="Margin" Value="2,2,2,2" /> <Setter Property="Foreground" Value="DarkRed" /> </Style> <Style x:Key="MyBoldStyle" TargetType="TextBlock"> <Setter Property="Style" Value="{Stat...

Which XML-related technologies I have to learn? (C# centric)

At my work as developer I do a lot of XML writing and parsing using C#. I have read very little about XAML, XSLT and XML schemas at Wikipedia and I don't see if they would make my XML-driven coding easier. Should I study any of these technologies? Which of them? Any other? ...

How to add more that one resource to a XAML window?

I have a little problem right now and I don't know how to fix it. I want to add two resources to a window. One is a XAML File style resource, the other a ValueConverter Class. Both of them work if I use only one resource at a time: <Window.Resources> <ResourceDictionary Source="Resources\MyStyles.xaml" /> <Window.Resources> or ...

Silverlight layout Best Practices

I'm writing a fairly big interface using Silverlight. As I progress, the xaml file is getting fairly big and is becoming proportionally uglier. Questions Are there any resources out there to make the xaml more readable? For example, how would I display the order of attributes (e.g. height and Width first) so that it looks the most ti...

Call XAML animation from VB code in WPF

Guys, here's what I'm trying to do: I have a Storyboard animation for an object done in Expression Blend. What I need is to be able to trigger that animation from the VB.net code. Any ideas? Thanks, ...

Debug error when calling a Storyboard to Start.

I have some storyboards in XAML (WPF Project) and I´m calling them from the VB code with this: Dim ServiceOff As Storyboard = DirectCast(FindResource("ServiceStopped"), Storyboard) ServiceOff.Begin() I´m getting the following error when trying to build: Overload resolution failed because no accessible 'Begin' accepts this number o...

Binding to an auto-updating object?

Is there an object or interface I can use to make an auto-updating object, and have those updates filter through to the UI in WPF? Basically I'm looking for something like this: <TextBlock Text="{Binding Source={StaticResource myClass}, Path=DataObject}" /> public class MyClass { public AutoUpdatingObject DataObject { get; set; } ...

Display "Wait" screen in WPF

I am trying to display a please wait dialog for a long running operation. The problem is since this is single threaded even though I tell the WaitScreen to display it never does. Is there a way I can change the visibility of that screen and make it display immediately? I included the Cursor call as an example. Right after I call this.Cu...

How do I prevent a WPF combobox popup from detaching when the combobox is moving?

I've got a textbox stacked on top of a ComboBox. The TextBox gets taller (via animation) when it gets focus, and shrinks back down when it loses focus. The problems start when the TextBox loses focus to the ComboBox. When this happens, the selection Popup (the part that "drops down") appears just below the ComboBox, as expected, but a...

xaml How reference a dynamic resource not as a attribute but as an element

I have an image I need to use in my application in several places. I want to define the image just once in a resource dictionary, and have my other xaml files just that definition. I can The one thing I haven't bee able to figure out is how to reference something defined as a xaml element instead of a attributed inside of a xaml attrib...

WPF: Show UserControl before all bound properties are loaded.

I have one UserControl which has a ListView showing a list of Client objects. Double clicking one of the rows plays an animation and transitions to another UserControl which shows the list of accounts for that client. The second user control is bound to the Accounts property on the Client object. The list of accounts is loaded the firs...

How can I add an additional item to a WPF ListBox using ItemSource?

I have a WPF form with a ListBox of items bound to a method that gets the items for the list box. What I want is an additional item at the top of the ListBox that behaves differently to the rest of the items. For example, let's say I have a list of Authors (databound to a List), and when I select an author it populates another listbox ...

Bring element forward (Z Index) in Silverlight/WPF

All the documentation and examples I'm finding online for setting Z-Index to bring an element forward in Silverlight are using a Canvas element as a container. My items are Border elements inside of an ItemsControl container in a DataTemplate. I'm using the MouseEnter and MouseLeave events to trigger an animation on the ScaleTransform....

Converting Autocad DXF to Microsoft XAML

Anyone got a good and preferably cheap and easy way to do this? The closest I got was to save a file to .SVG and use Inkscape to convert it to XAML. All lines and such converted nicely, but all the text was just a pile of text on top of the document. I also tried importing the DXF to Adobe Illustrator and using Mike Swansons AI to XAM...

What is xmlns in every WPF file?

What is xmlns? What role does it play in an XAML file when we create a WPF project? ...

WPF Service Control app won't build

I have the following code: XAML code for Window1.xaml and the VB.Net code for Window1.xaml.vb. The error I get is the following: "Cannot create instance of 'Window1' defined in assembly 'ServiceControl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in marku...

XAML Expert Questions

I am a small ISV. 2 developers. I have an existing application for windows that we sale. I would like to rewrite the UI using WPF and maybe even create a Silverlight version on the web. I have 20 years experience, and I learn things fast. I am sure I could learn XAML, WPF, and Silverlight. However, I am wondering if I should write the i...

WPF ComboBox Binding Unchangeable

I am trying to bind a ComboBox to data from an object. The object holds a list that is the allowed states and a string that represents its current value. The problem I'm having is that when the form loads it correctly sets the value of the combobox to its current value but I am unable to change the value to anything else. If I click t...

.NET WPF XAML Namespace Mapping for Enum types

I'm binding a collection of my W3CErrorOrWarning type objects to controls in a WPF Window. One of its properties is named "Type". It is of type W3CErrorOrWarningType which is a simple Enum: Enum W3CErrorOrWarningType ValidationError ValidationWarning End Enum I'm trying to use it in this way... <Window ... xmlns:en...

.NET WPF XAML "BindingExpression path error: ... property not found"

I was trying to bind a collection of my W3CError type objects to a WPF ListView control. It was a nice little 13 line class... Class W3CError Public Type As ErrorOrWarning Public Line As Integer Public Col As Integer Public Message As String Public MessageId As String Public Explanation As String Public So...