xaml

How can I make a Button appear in the Header of a WPF TabItem using bindings?

I am creating a UI in which a TabControl has a series of standard TabItems with ordinary WPF controls as their content. The headers just display ordinary strings as usual. However, I want the header of the last item to contain a Button instead of an ordinary string. Let me stress that I already know how to do this without bindings. I wa...

VIM for XAML editing

Can VIM be used for XAML editing? ...

Using BasedOn Style Property on DynamicResources

hi there, i wonder if there is a way to use the basedOn property of wpf styles with dynamicresources. e.g. <Style BasedOn="{DynamicResource somestyle}"> <Setter Property="SomeProp" Value="SomeValue"/> </Style> this e.g. throws an error indicating that the usage of dynamicresources in combination with BasedOn styles is not possible...

Draw custom element between listbox items

I want to draw custom elements (like an empty square> between the items of a listbox, to indicate that users can insert/drop items from another listbox between other items. How can I do this? I have some rather hacky solution for this, but I hope there is an easier way to do this. One of the ideas is to use different DataTemplates for ...

Adding the xaml file in ASP.net web Application

How to add the xaml file in ASP.net web page. ...

In WPF, what are the differences between the x:Name and Name attributes?

The title says it all. Sometimes it seems that the Name and x:Name attributes are interchangeable. So, what are the definitive differences between them, and when is it preferable to use one over the other? Are there any performance or memory implications to using them the wrong way? EDIT Responses so far suggest that using x:Name al...

My images are blurry! Why isn't WPF's SnapsToDevicePixels working?

I'm using some Images in my WPF applcation. XAML: <Image Name="ImageOrderedList" Source="images/OrderedList.png" ToolTip="Ordered List" Margin="0,0,5,5" Width="20" Height="20" SnapsToDevicePixels="True" MouseUp="Image_MouseUp" MouseEnter="Image_MouseEnter" MouseLeave="Image...

Expression Blend Books?

Are there any good Expression Blend books out there yet? The help file is better than I'd expected it to be. But I'd really like to get ramped up faster. ...

How can I bind a dataset directly to a TreeView (with hierarchy)?

If I have a DataSet as a result of a SQL query, can I bind it directly to a TreeView and show the hierarchy of my data? I know I'd have to use several HierarchicalDataTemplates, but I don't know how to tell each one what data to display. If I have a 4-level hierarchy, like so: <HierarchicalDataTemplate x:Key="FirstLevelTemplate" ItemTe...

WPF: Remove dotted border around focused item in styled listbox

I have a horizontal listbox with a custom controlIemplate. The selected item gets a dotted frame when focused. Anyone know how to get rid of it? ...

Why does this WPF button stretch across the window?

The button below always expands to be as wide as the TextBlock. I've tried StackPanel, DockPanel, Width="Auto", etc. How can I make the button expand to the size of its own text (as in HTML) and not to the size of text in its environement? <DockPanel HorizontalAlignment="Left"> <Button x:Name="ButtonFavorite" ...

How can I get IntelliSense to auto-complete an enum on a custom/user control in XAML?

In XAML if I am defining the Orientation property for a StackPanel, IntelliSense brings up the Orientation enum. If I'm defining my own control with a DependencyProperty based on an enum, is there a way to get IntelliSense to bring up the enum? Enum: public enum MyEnum { Foo, Bar } DependencyProperty in control: public static reado...

Silverlight page not catching input events

I have been attempting to handle the KeyDown event of a UserControl (page) in my Silverlight application, but there seems to be some strange behaviour on the part of Silverlight user input functionality. The event is not getting raised under any circumstance. I have even tried attaching the event handler to each container control within ...

Does Expression Blend have a concept of trim/crop?

I'm rebuilding the graphic on the left as the graphic on the right in Expression Blend. The gradient brushes are great for creating reflection effects but how do I now trim the button on the right now so that it cuts off the rest of the reflective circle? I can rotate, scale, skew, recenter, and flip but I can't find trim or crop. A...

How can I bind to an enum in WPF with a "current" value

I have a simple .Net enum. I also have a view model object which has a "CurrentValue" property of the type of my enum. This property can be data-bound (the object implements INotifyPropertyChanged). Now I'd like to show one UI element for each value of the enum, in a specific order, and have the "CurrentValue" highlighted (bold). I would...

WPF/XAML Style set Property for child items?

Hello, I working on a XAML style for my controls. The code below is for setting the color of a stackpanel. It works fine but there is something else I want to do. If the trigger is activated I want to set the font color for all child items inside the stackpanel. At the moment I only have textblocks inside the stackpanel and I know I co...

Referencing controls in a WPF DataTemplate

In a WPF page that I'm designing for my church, I have two ListBox controls bound to the results of two Linq-to-Entities queries: the first listbox/query contains all the folks who haven't yet pledged for the year, the second listbox/query contains all the folks who have pledged (and their associated pledges). Specifically: var familie...

Silverlight: "The name already exists in the tree"

Hi, this is a problem that regularly arises when I write Silverlight XAML. In this case, I've made a usercontrol VerticalTabStop (code attached) that has a ToolTip attached. I instanciate a couple of my usercontrols, and then I get the debugging window and the following error: Line:52 Error: Unhandled Error in Silverlight 2 Application ...

XAML Vector to Illustrator or similar

Hi, I can easily enough go from Adobe Illustrator and make a XAML file via the XPS Virtual Printer, but is there any way to import Vector graphics defined in XAML into Adobe Illustrator to continue working on it? Cheers Nik ...

XAML tag list reference

As the question suggests I'm simply looking for a XAML tag list reference. I've banged the obvious queries in Google/SO but not found what I am looking for yet. Any useful links welcome. Cheers, Chris. ...