xaml

How can I indicate in an Expander header that collapsed contents have an error

Hi, I have expanders that contain text boxes, the text boxes use the wpf validation stuff to draw a red box around them ( text boxes are wrapped in Adorner Decorators to make sure I don't get empty red boxes everywhere when the expanders are collapsed) I want to indicate in the header of the expander that it has contents that have erro...

WPF XAML Global Reference

Is there a way to reuse a 3rd party control reference? For example, I have this referenced in my App.xaml xmlns:cust="clr-namespace:ThirdParty.Controls;assembly=ThirdParty.Controls" I don't want to repeat this 3rd party control xml namespace on each page/control that needs a control from the library. Is there anyway to centralize ...

Binding to an element within a UserControl

Say I have a user control like the one below, how would I bind something to the ActualWidth of the "G1" grid from outside of the control? <UserControl x:Class="Blah"> <WrapPanel> <Grid x:Name="G1"> ... </Grid> <Grid> ... </Grid> </WrapPanel> </UserControl> ...

Silverlight 2 User Control - Unknown attribute name on element

Update: Screenshot http://farm4.static.flickr.com/3277/3048788466_661e8e5e78_b.jpg To reproduce: Get this sample project from Silveright.net - http://download.microsoft.com/download/5/9/2/5922d533-7ed5-4065-a138-ce3d9ca266e5/4-UserControls_Source_CS.zip Open the UserControlDemo Solution. Then on Line 9 of Page.xaml, you'll see the e...

WPF Tab View, Custom Templates, and Accessibility

I'm having a problem with the WPF Tab View control that I was hoping someone here might be able to help me with. I want my tab view control to use rounded corners for the tab headers, because I think rounded tabs look better. To do this I modified the default control template for the tab by using the "Edit Copy" command in Expression B...

Using a XAML vector image as a window icon

LearnWPF.com posted this article about converting bitmap images to XAML and using them in your applications. The outer element of the XAML image is a Canvas. However, the Window.Icon property only accepts an ImageSource object. Does anyone know how I can 'wrap' the Canvas in an ImageSource so I can use it as a window icon? Alternativ...

wpf storyboard death

C#: public partial class MainWindow : Window { Storyboard a = new Storyboard(); int i; public MainWindow() { InitializeComponent(); a.Completed += new EventHandler(a_Completed); a.Duration = TimeSpan.FromMilliseconds(10); a.Begin(); } void a_Completed(object sender, EventArgs e) ...

Source for xaml toolbar icons?

Could you suggest a source for xaml toolbar icons (new, open, save, print)? ...

why not partial class to build the ViewModel in MVVM pattern?

Why not use partial class to build the ViewModel? Since the definition of viewmodel classes have some definition of the data classes of datamodel, why not try to reduce some work, extending or making partial classes of the datamodel, completing them with command and etc. ...

How do I bind a WPF DataGrid to a variable number of columns?

My WPF application generates sets of data which may have a different number of columns each time. Included in the output is a description of each column that will be used to apply formatting. A simplified version of the output might be something like: class Data { IList<ColumnDescription> ColumnDescriptions { get; set; } strin...

[WPF] AccessKey/Hotkey in custom textual MenuItem.Header possible?

Is it possible to access the following formatted menu item like any other standard menu item (using the underscore-method, e.g. "_File" would be accessible by pressing "f")? I would like to use "O" as "access key" here. Unfortunately, <AccessText> does not seem to be usable directly (I imaginged something like <AccessText Visibility="...

Changing the StartPoint/EndPoint of a LinearGradient brush in Expression Blend UI

Seems like as really simple thing to do, but I just can't track it down in the help or online. I know how to change the XAML to set the StartPoint and EndPoint of a LinearGradient brush, but I don't know how you do it using the IDE in Expression Blend - does anyone know the keyboard/mouse actions that you use to do this? ...

WPF: How do I edit the contents of a DockPanel that is located inside a UserControl?

I've created a user control (in vb.net code) that contains two dock panels, one for header content (called HeaderDockPanel) and one for other content (called RootDockPanel). The dockPanels are depedency properties of the user control. These dependency properties are declared as follows: Public Shared ReadOnly RootDockPanelProperty As D...

Silverlight 2.0 - databinding a domain object to a UserControl

I am starting out with Silverlight. I want to display a list of messages on the UI, but the databinding isn't working for me. I have a Message class: public class Message { public string Text { get; set; } ... } I have the message display Silverlight User control with a Message dependency property: public partial class M...

Silverlight 2.0 - scroll vertically, wrap horizontally

In silverlight 2.0. I have some content that i want to scroll vertically and wrap horizontally. In the controls I have a dock panel. The DockPanel's last child, which fills it, is a ScrollViewer <UserControl x:Class="MyProject.MyControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.m...

Can a wpf application be deployed without compiling the xaml?

Is it possible to deploy a WPF windows application in such a way that the xaml files can be manipulated at run-time? If possible, I would imagine this would work similar to an asp.net application that can deploy the .aspx pages as content, which are then compiled just-in-time at run-time. I'd like to allow the simple layout of a screen...

Silverlight 2.0 - Can't get the text wrapping behaviour that I want

I am having trouble getting Silverlight 2.0 to lay out text exactly how I want. I want text with line breaks and embedded links, with wrapping, like HTML text in a web page. Here's the closest that I have come: <UserControl x:Class="FlowPanelTest.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=...

How to implement design time validations for XAML, that result in compile errors?

How to enforce that developers writing XAML in Visual Studio should follow certain standards and validations need to be run and if invalid compile time errors are thrown. For example, making sure that all the databinding expressions (some are real long) are written correctly as per 'a custom validation' I would like implement, during de...

WPF CommandParameter is NULL first time CanExecute is called

I have run into an issue with WPF and Commands that are bound to a Button inside the DataTemplate of an ItemsControl. The scenario is quite straight forward. The ItemsControl is bound to a list of objects, and I want to be able to remove each object in the list by clicking a Button. The Button executes a Command, and the Command takes ca...

Enable ListView multiselect by dragging

How do I enable multi-select in a WPF ListView by dragging? Setting the SelectionMode property to Extended does allow multi-select using Shift and Ctrl, but not by clicking and dragging. Setting the SelectionMode property to Multiple gives a sticky selection which isn't what I want. ...