xaml

Not able to use XAML extracted from Adobe Illustrator in WPF

I've created a design in AdobeIllustrator. Then I opened design in Microsoft Expression Blend, and got entire XAML code of the design. I tried to apply the XAML and create custom button with the same shape as in my original design. This is what I did: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

How to get the height of the title bar of the main application windows?

I'm using prism to load views to region. The problem is the loaded view overlapped the title bar of the main windows - the bar contains caption, close/minimize/maximize buttons. How can I get the title bar's height? Prefer to get it right in the xaml codes. ...

Referencing enum defined in a class from within XAML

In Expression Blend 4 (Silverlight project) I have a UserControl to which I have added a CLR property. This property is an enum type, which is defined within the UC. I have attached a ChangePropertyAction behaviour to an instance of the UC. However, the XAML parser gives the following error (among others): '+' is not valid in a name ...

VS2008 WPF Xaml: Is there a path length limit when loading an assembly?

Hello, It seems that there is a path lenght limit for VS2008 when loading XAML assemblies. Using the Microsoft sample Southridge, if the project is stored on "C:\Projects\C# samples\Southridge_Labs\1.Southridge_Fundamentals\Start" the designer does not load the assemblies. But if I copy my files the project to the root (C:\Southridge_...

How to use both Command and EventTrigger in DataTemplate Button?

I have a Button in a DataTemplate that is bound to a Command in my ViewModel. The button also has an EventTrigger that kicks off a Storyboard that hides the edit controls (of which the button is a part.) The Storyboard works fine if I pick up the PreviewMouseDown event, but the Command never gets called. If I pick up the MouseDown event...

WP7 Is it possible to have a two color background without using an image?

I'm looking to create a background with the top 48 pixels one color, and everything below it another color. I've created a style, but it crashes the phone with a "XamlParseException" when I try to use it. <Style x:Key="BackgroundStyle" TargetType="Grid"> <Setter Property="Background"> <Setter.Value> ...

Why is IronPython 2.7 throwing an exception when I create WPF bindings from XAML?

I've just installed IronPython 2.7 with VS support, and am trying to create a simple prototype WPF application. Something is broken, probably in my installation, and I can't figure out how to diagnose it. I can't get the simplest of bindings to work; they fail with an exception that seems really, really wrong. I create a WPF applicat...

Dynamically binding to property of child controls

Would it be possible to bind to Validation.HasErrors on any child control of a panel, without explicitly binding to every named control? Specifically i want to fire a trigger on a general style of a panel if any child control is in error state. Thanks. ...

Binding not works on DependencyProperty

I have a window which has a usercontrol in it . This usercontrol's RequestObject property bound to SearchArgumentObject property of ViewModel of the window. This is listing from my window class <Grid DataContext="{Binding SearchArgumentObject, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <guiLib:RegCardSearchForm x:Name="S...

Getting XAML designer to show design in VS2010

I am starting to learn WPF and I grabbed the Family.Show project as a real-world example to help me learn. It's got a pretty good UI, and some cool animations in the main panel for the family tree -- I'd love to see how they did it. So I downloaded the source code (http://familyshow.codeplex.com/releases/view/23637#DownloadId=59428), o...

WPF. Layout issue.

Hello, guys I have StackPanel. I need place there TextBlock with TextAlignment = TextAlignment.Center[Center of stackPanel] and button at right side with small margin. How can I achieve such layout with wpf. How can I add button to StackPanel, that my TextBlock doesn't move from center. ...

expander overflows

c# vs2010 hi all: how can I bring to focus on a window all controls hidden on expander. expander is collapsed at the bottom of the window, when i click on it to expand it (i have to scroll down,'cause controls are not showing on the window), I would like to bring into focus the first control and be able to see the last control on the...

WP7 Using TransitioningContentControl for different forward and back animations

I'm using the TransitioningContentControl to create animations for navigating between pages. I used this blog post as my guide: http://wildermuth.com/2010/07/16/Bring_Back_Page_Transitions_to_the_Windows_Phone_List_Application_Template I also found this post that does something very similar: http://www.slickthought.net/post/2010/04/26/S...

Declaring Tuple in Xaml

Is there a way to declare a tuple in xaml so I can use it as a converterparameter? ...

MultiDataTrigger with value range

I have several conditions that need to be met in order to allow a user to edit the details of the selected item. the conditions are: if the item is active they are allowed to edit it regardless of security level. No problem there. if the item is inactive: users above security level 50 can edit it users below security level 50 can only...

Update UI when property is changed

I am quite new to WPF and I am confused about how Data Bindings should behave. I have created a class that has 1 property ("status") and three methods that are responsible for changing the status. This class implements the INotifyPropertyChanged interface so that I am able to notify the calling code when the Status changes. The class l...

Constants in xaml

Let's say I have a class defined something like the below: namespace MyProject.MyConstants { public class Constants { public class Group1Constants { public const string DoIt= "DoIt"; } } } I am trying to use this const, from a separate project, in my xaml. I included the namespace: xml...

How can I cause a Button within a StackPanel to fade in when hovering over the StackPanel?

I have a ListBox containing a StackPanel which contains a CheckBox and a Button. I want the button to fade in when the mouse is hovering over the StackPanel. I would like to do this declaratively using XAML if possible. I have attempted this with the following code to no avail. Any thoughts as to what I am doing wrong? <UserControl...

How to change ancestor's property with a trigger on template child

I have a combobox and I have templated its control template. Togglebutton is a part of the control template. Now when a event is raised on the togglebutton(ex: Checked), I want to change combobox property(ex:Foreground). How to do this? Can we do this using relativesource? ...

How can I define DataGrid's rows declaratively in XAML?

I have this code and I need to bind second and third cells in rows to different properties. Sorry for my bad english. <DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch" Name="measureDataGrid" VerticalAlignment="Stretch"> <DataGrid.Columns> ...