xaml

Scatterview itemsource

Hello, I have an Scatterview with an itemSource property. Now the documentation explains: "When an application sets the ItemsSource property of a ScatterView control, a ScatterViewItem element is created for each object that the ItemsSource property provides" But I want to display items in a scatterview with a fixed size and positio...

Nesting a Progress Bar into a Combobox in WPF

Is it possible to nest a Progress bar into a combobox or the other way around. I want to be able to type into the combo box and hit a button and the progress bar shows the progress of the event, like in Windows Explorer. EDIT: I need the code in Visual Basic.NET 3.5 Thanks. ...

XAML: Refer to StaticResource in plain XAML? (without markup extension)

I am setting a validation rule on a series of textboxes. I'd rather not create a new instance of my custom validation rule for each TextBox... <Window.Resources> <my:IsIntegerRule x:Key="IsIntegerRule"/> </Window.Resources> ... ... <TextBox> <TextBox.Text> <Binding XPath="@num" UpdateSourceTrigger="PropertyChanged" Mode="T...

WPF - Custom Mark-up Extensions return RoutedEvents

Hello! I'm trying to create a generalized event for my Close buttons, where they have to close the window but before that set focus to the owner window. I don't want to have an event for every file for that, because that'd be pretty unpractical since I have 30+ windows in my application. (So if I wanted to change that behavior, i'd have ...

How to create an outline view of a FlowDocument

I am working with a FlowDocument in a RichTextBox and I need to find a way of displaying the block hierarchy. I envisage using something like the WPF GroupBox whereby each block element is assigned a border and a non-editable identifying label. The borders will clearly show which block elements are contained within other elements and the...

WPF - Static Binding - Error shows up but everything works fine

Hello Ok, I have a specific custom behavior for my MenuItems. So I bind the windows from my static class FormsResource and it works perfectly. But, very often, I get an exception "Exception has been thrown by the target of an invocation" in the 3 lines where I have "{Binding Source={x:Static local:foo}}" I can't see the inner exception, ...

Silverlight XAML databinding to a field

Hi, in the following code, <riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:V_FinanceCalculatorDefaultValues, CreateList=true}" Height="0" LoadedData="v_FinanceCalculatorDefaultValuesDomainDataSource_LoadedData" Name="v_FinanceCalculatorDefaultValuesDomainDataSource" QueryName="GetV_FinanceCalculatorDe...

Changing the appearance of collection of items according to a single property in XAML

I have 4 buttons in grid which datacontext is set to an object which has property that indicates what button should be enabled (it's enumerable). Currenty I have done this in code-behind so that when that specific property changes, it disables all but one depending on the value. It works, but I really don't like to put stuff like this t...

Is there a way to re-use Styles for Shapes in Silverlight 4?

I'm trying to create a resource Style for a Path (Shape), however, when creating several Paths that use the Style, only the first one is rendered. //In resources xaml <clr:String x:Key="path">M 50,50 L 35,15 A 8,10 0 0 1 65,15z</clr:String> <Style TargetType="Path" x:Key="pathStyle"> <Setter Property="Stroke" Value="Black"> </Style...

Binding in WPF style causes inexplicable "Cannot find governing FrameworkElement" error

I have an ItemsControl that displays a bunch rectangles. Each rectangle needs to be offset upward and to the left. So, I created a RectangleStyle that uses bindings to set the width, height, X translation, and Y translation for a rectangle. The width and height bindings are working fine, but I'm getting the following error for the Tran...

XamlWriter/Reader -> multiple constructor calls resulting in duplicate elements

hi there, i'm kind of stuck here. i'm using a dragndrop-library which serializes the dragged UIElements via XamlWriter.Save(). now i'm trying to dragndrop some instances of a class extending Grid. in the constructor i push some elements into the visual tree. the constructor gets called when the object is deserialized and the elements ...

Create a slanted-tab header in Silverlight

Hi, I wanted to create a slanted tab header using the tabitem control in the silverlight toolkit. I want it to look like the image below but i'm not sure how to accomplish this. http://img713.imageshack.us/img713/1462/silverlighttabs.png Any help and direction would be gladly appreciated Thanks, Keith ...

Assign Hotkey to a MenuItem (File) to drop it.

Hi, i am having an issue dropping down the File menu using the hotkey alt+f. I have successfully been able to drop it if alt is pressed and released followed by an ‘f’, opens the menu but pressing f with alt doesnt do the trick. This is the code that i am using. < Menu Name="File_Menu" Background="LightGray"> < MenuItem Header="_File...

Grid inside grid in xaml

I want to have childGrid in second column of parentGrid (in chilGrid I want to have two columns: first for labels, second for textboxs) How can I do Something like that: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Height="*"/> <ColumnDefinition Height="*"/> <RowDefinition Height="*"/> ...

Why doesn't this command binding work?

Hi, I have a WPF application which has a main window composed from several custom UserControls placed in AvalonDock containers. I want some of the UserControls' functionality to be accessible from a toolbar and menubar in the main window. I have a command defined as this in the control like this: public ICommand UnfoldAllCommand ...

Looking for WPF/Silverlight 'device ring' example

I'm looking for an example of a 'device ring', somewhat like the one used in Live Mesh (anything in a ring will do) in XAML (WPF/Silverlight). Preferably with demo code or open-source so I can have a look at how things work under the cover. Other animations, like resizing of the elements if they move around the ring, are a nice extra, bu...

Adding Properties to Custom WPF Control?

Hey all, I just started WPF this morning so this is (hopefully) an easy question to solve. I've started with creating a button that has a gradient background. I want to declare the gradient start and end colors in the property of the control and then apply them in the template. I'm having trouble getting the code to compile though. ...

How to use WPF custom control properties in XAML Template?

Hey all, I've created a custom control that is intended to be used as a button but has properties to specify points for a polygon (to be drawn inside the button) and two colors for the gradient. I've declared all the properties in the code and then written the template in the XAML but it doesn't seem to be working. If I hard-code the ...

How to resize a polygon in WPF?

Hey all, I'm working on my first WPF application and I'm testing out a custom control that is essential a circle with a play button drawn into the middle of it. I seem to have hit a bit of a hitch though. When I draw my play button I can't seem to get it to resize alongside the circle. Specifically, when I resize the circle to be wid...

Define DesignWidth and DesignHeight in StaticResource

I wonder if I can put mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" in StaticResource, is that possible? ...