xaml

BorderThickness of 1 renders with a 2-pixel thickness - what am I missing here?

I've got a Border in XAML/WPF that I'm using to give a full-paragraph-width underline to text headings in a dialog. I set its BorderThickness property to "0,0,0,1". In some places, it ends up being rendered with a 2-pixel thick underline while in others it appears correctly as a single-pixel underline. What am I doing wrong? Here's the ...

Close Popup when focus lost

Hi all, I have a popup containing a ListView. The ListView contains customer names. The popup is openen when a search bar is clicked. The user can enter text in the search bar (TextBox) and the Listview is filterd based on the input. I want to close the popup whenever it loses focus. However, the default "auto close" behaviour StaysOp...

Underline Text in Label which is in a DataTemplate

Hello, i have a ListView which contains objects bound from an collection. The representation of the objects i have set with data-template. Now i want to do the following. There are two TextBlocks in my DataTemplate: <DataTemplate> <StackPanel> <TextBlock Text="{Binding Name}"></TextBlock> <TextBlock Text="{Binding Path...

Animation in Silverlight using a dynamic value

I want to translate an object on its Y-axis over time in Silverlight, but its height is not constant, so I'd like to be able to change the second line of the following from: <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Childr...

WPF: Eating a click on a ComboBoxItem

I have a ComboBoxItem [Line Color] that displays a PopUp on IsHighlighted and I want to eat the click on the ComboBoxItem. I know how to do it programmatically but I was wondering if there's any way to accomplish this in XAML? ...

WPF, Xaml and the future of MS Development

I am beginning to heavily invest in WPF and was wondering what those more knowledgeable than myself thought as to the wisdom of this decision. Is WPF the way forward? ...

What approaches are available to dummy design-time data in WPF?

I am working without expression blend and just using the XAML editor in vs2010. The wisdom of this aside, I am increasingly seeing a need for design-time data binding. For simple cases, the FallbackValue property works very nicely (Textboxes and TextBlocks, etc). But especially when dealing with ItemsControl and the like, one really need...

WPF Warning with VSTS: Different checksum values given for '*.g.cs' Files

In Visual Studio 2008 Team System, this is my warning: Different checksum values given for '<some folder>' ...\Visual Studio 2008\Projects\... \Debug\...\SomeFile.g.cs The offending line in the SomeFile.g.cs file is: #pragma checksum "..\..\..\..\..\..\...\SomeFile.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "A18BC47B27EC4695C69B6...

WPF - Keep button enabled even in container is disabled.

I have a button in a ListBoxItem. I want the button to stay enabled even if the list box Item is disabled. Is this possible? Here is my style code for the listbox, listbox item and the button (called btnPick). <Window.Resources> <Style x:Key="CheckBoxListStyle" TargetType="ListBox"> <Style.Resources> <Style TargetType="ListBoxI...

WPF: Open source of xaml control examples

I'm teaching myself WPF and xaml by replicating existing controls and UI from AutoCAD 2010 and Excel 2010. Once the various controls are polished, I would be happy to share any code. Is there sites or communities that are open source and WPF or xaml based? ...

Capturing WPF Runtime BindingExpression errors...

We can all see Runtime BindingExpression errors in the Visual Studio Output Window. But can we capture these events in the running app itself? I'm hearing about WPF tracing... does this have something to do with this facility? Also, the System.Windows.Data namespace contains no documented events (like a BindingExpression error event), wh...

Can MethodParameters in an ObjectDataProvider be databound to other controls?

I've been exploring WPF and XAML for a while now, but have hit a slight stumbling block revolving around binding to a method. My situation is: There is a ComboBox bound to a DataTable. There is a ListBox bound to the return value of a method (GetDates) via an ObjectDataProvider. One of the input parameters of the method GetDates is an ...

WPF: Ribbon control application button and quick access toolbar location

How is the Application button and quick access toolbar placement accomplished? ...

How to Centre Silverlight Elements relative to each other?

I have an Ellipse and a TextBlock that I want to be Centred relative to each other - ie the TextBlock shows in the Centre of the Ellipse no matter the content eg. its says 88 (like a Bingo Ball) and the Ellipse is the Ball itself - and the number shows in the centre of this ball. How to I accomplish this in Silverlight, where the sizes ...

Specifying DataTemplate.DataType with a custom type extension

I have this markup extension public class NullableExtension : TypeExtension { public NullableExtension() { } public NullableExtension( string type ) : base(type) { } public NullableExtension( Type type ) : base(type) { } public override object ProvideValue( IServiceProvider serviceProvider ...

How do I bind to XmlDataProvider whos source has a default namespace (xmlns) set?

I have XML similar to the following <?xml version="1.0" encoding="utf-8"?> <foo name="FooBar" xmlns="http://mydomain/myapp/ver/myschema.xsd"&gt; <bars v="test"> <bar bat="one"/> <bar bat="two"/> <bar bat="three"/> </bars> </foo> How do I map this in WPF, it works if I don't set the default namespace, ho...

How can I refresh a custom wpf user control from code behind?

I have this custom wpf user control: ShowCustomer.xaml: <UserControl x:Class="TestControlUpdate2343.Controls.ShowCustomer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid> <TextBlock Text="{Binding Message}"/> </Grid> </UserContro...

Bind a value to a control's absolute position in XAML

Is there a way to bind a value to the absolute position of a control using XAML? I have a Line element that I would like to be drawn between two Buttons in my application. I was thinking that binding the starting point of the Line to the position of the Button would be the easiest way to make this happen, using RelativeSource somehow. ...

Children Controls Are Inaccessible Due to Access Modifier

When I create a user control in WPF it would appear that all the children of this control are declared as internal? I've not been able to verify this, nor finding any resources discussing this matter at all. I can access the controls in the same assembly, but not in a project referencing the assembly where the user control is located. I...

xaml: Is there a method to implement OR logic in multiple triggers?

I want the Role to be either TopLevelHeader OR TopLevelItem as well as IsPressed. Is this possible without specifying two MultiTriggers? <MultiTrigger> <MultiTrigger.Conditions> <!-- IsPressed --> <Condition Property="IsPressed" Value="True"/> <Condition Property="Role" Value="TopLevelHeader"/> </MultiTrigger.Conditions> ...