xaml

Why is DataGrid "Auto" width so huge all the sudden?

I have been working on an app with a datagrid from the wpf toolkit and the width was not specified in the xaml (default to auto), and it was working fine. It would extend the window width as I resized the window. However, all the sudden the "auto" width is massive and I don't know why. When I pull the xaml file up in blend it shows auto ...

WPF / XAML - Can text be auto sized?

For a fixed size wrappable text area, is there any way to make the font size as large as possible based on the amount of text? For example, if you have a 500x500 area with the text "Hello", the font size would be really big. But if you have a paragraph of text the font size would be smaller to fit into the area. I have looked at Viewb...

What is the best way to remove a layout element

I have a progress bar shown as I am loading images with the webclient object asynchronously. Once the images have been downloaded I set the loadingComplete bool property to True in my viewmodel to indicate that the loading process has been completed. Currently I am using this value for an attached property to set focus on a control. Wha...

Window.Margin & Window.Padding don't work

hello. I am setting peroperty Margin and Padding of a window and it doesn't take effect: Here is an example: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" SizeToContent="WidthAndHeight" ResizeMode="NoResize" Padding="22" Margin="...

WPF: Minimizing code-behind on the user interface.

I've been playing with WPF/XAML again and have noticed that there doesn't seem to be an easy way to code UI-only keygestures/mousegestures and the like. For example, how to add a "Maximize without windowframe" command to a window. Currently this involves code not unlike this in code-behind: public partial class MainWindow : Window { ...

WPF ComboBox DropDown part appears in the wrong place

I put several ComboBoxes on a XAML window. When I expand any of them, the DropDown part appears on the upper left corner of the screen. I use Visual Studio 2008 C# Express. I don't remember this phenomenon when I used Visual Studio 2008 (Trial Version), though I use the same FrameWork (3.5). ...

Embedded XBAP in IFrame always on top

It is possible to embed an XBAP application into an IFrame, this is rather easy !! The problem however is that it renders on top of anything within the web application. For example! I have a menu in my web application which can collapse when I hover above it, but it will collapse UNDER the IFrame when it needs to collapse ON TOP of th...

How to implement a TypeConverter for a type and property I don't own?

This is annoying: <GeometryDrawing> <GeometryDrawing.Pen> <Pen Brush="Black"/> </GeometryDrawing.Pen> </GeometryDrawing> I want this: <GeometryDrawing Pen="Black"/> So I write a TypeConverter: public class PenConverter : TypeConverter { static readonly BrushConverter brushConverter = new BrushConverter(); ...

Silverlight Toolkit ImplicitStyleManager and Databinding

I have a UserControl that is using the ImplicitStyleManager. Controls on this UserControl (like buttons) are correctly styling with implicit styles. However, buttons in a datatemplate in a databound ListBox control are not picking up the styles. I have tried setting the mode to Auto. Am I missing something? ...

Creating the ListView in WPF ?

Hi guys and happy new year(2010). I'm a kind of novice in WPF's ListView. I'm gonna create the following ListView in WPF via XAML and C# : http://xs.to/image-A835_4B3EF7EE.jpg Could you please guide me , how I can do it ? Thanks. ...

How to represent system constants in XAML (like double.MaxValue)

What is the xaml equivalent of MyProperty = double.MaxValue? I'm afraid I'll need to use something like MyProperty="{x:Static sys:Int32.MaxValue}", but not sure, and can't find the equivalent for double. Thanks. ...

Simple WPF Custom Control - How to set background color?

I've created the simplest possible WPF control - It just overrides OnRender and draws a red rectangle. However ONLY when setting the Background in XAML to Blue, the control is all blue with no red showing. If Background is not set, the red rectangle shows no problem. How come the red rectangle is not displayed over the blue backgrou...

XAML Binding Question

Hello, I have an object, say Person, which has First Name and Last Name properties. on my WPF UI, I have a Label which needs to bind to the full name. how can i concatinate in xaml. . i dont want to create another readonly property like FullName{get FisrtName+""+LastName} . can we do this in XAML?. Thanks, Rey. ...

WPF Stop Storyboard on Visibility Changed

Hello, I have a UserControl with a story board and I want to stop the animation when the control's Visibility changes. I created a Trigger to pause the animation and start it depending on the state, but I keep getting an ArgumentException. Here is the XAML: <UserControl.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded...

XAML/WPF: How do I bind a command to a comboboxitem.

I want to bind a command to a comboboxitem much like a typical command (either application or custom) is bound to a button. I can't seem to find an example. EDIT: The ComboBoxItem exists as part of a ContentControl that also contains a button. The button has an associated command that works well. How can I bind a command, in a simil...

How do I keep a constant FontSize in WPF Viewbox?

I have a Viewbox with a number of TextBlocks that are scaled and positioned perfectly by the ViewBox. Something like this: <Viewbox Stretch="Uniform"> <Canvas Width="100" Height="100"> <Ellipse Width="100" Height="100" Stroke="Black"/> <TextBlock Width="100" TextAlignment="Center" FontSize="12">Top Center</TextBlock>...

Why the Path and Polyline have different renderings in WPF?

Why the Path and Polyline have different renderings in WPF? This is happening both in code and blend, maybe a I missing something or this is just a anti aliasing effect. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="GeometryMonky.Window1" x:...

Strange problem with IsMouseOver on button in ListBoxItem

I have a template for my list box item. It includes an image button. The button changes images when you hover. The problem I'm having is it's adding a weird artifact to the button when I hover. This ONLY happens though if it's in a ListBoxItem. If I put the button on the main canvas, it works fine. Here is the image in the normal state...

How do you find the default values of controls in XAML?

I have seen that in Blend you can see which properties have been changed and use the reset option to get back to default values. Is there any other way of finding what the default values of a control are? JD ...

How to style a fancy vertical ProgressBar correctly?

I'm trying to make a stylish progress bar, but I'm having a problem with its vertical version. A picture is worth a thousand words: Everything I've attempted so far has resulted in Wrong. How do I achieve Right? I'd prefer a XAML only solution unless it's slow or causes flickering when the progress bar is updated many times per second...