xaml

Does XAML design mode support more color than code view?

While working with SilverLight using Visual Studio 10, I found that in design mode XAML allows a wide plethora of colors. For ex. Lime is a valid color in XAML. <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"> <GradientStop Color="Yellow" Offset="0" /> <GradientStop Color="Lime" Offset="1" /> While working with code th...

Default Style ListBox / ListView / ComboBox SelectedItem

Hi everyone, I would like to know what setters I have to change in XAML to remove the default style when you select an item in any collection like(listview/listbox/combobox). By default it's blue,but I didn't want any visual aspect cause my listbox contains a stackpanel of objects and I didn't want a blue background around the item if t...

WPF Creating an instance of a class in xaml

Hi, I have a problem with creating the instance of a class in xaml file. I thought you can do it like this: <src:MyDataClass x:Key="data"/> in the resource part of the user control and then use it in the xaml file (for example bind to it). But even tough the class I created is located in the same namespace it says that: "The typ...

Setter in property trigger fails if target property already has an explicit value

I'm currently trying to create a ControlTemplate for the Button class in WPF, replacing the usual visual tree with something that makes the button look similar to the little (X) close icon on Google Chrome's tabs. I decided to use a Path object in XAML to achieve the effect. Using a property trigger, the control responds to a change in t...

Multiple Validation Rules and Validation Templates in WPF

Does anyone have a tactic for dealing with multiple validation rules and templates for those validation rules. Example: I want to have two validation rules (required & data) I want either... One template that can change is display depending on which rule is fired or Two templates, which get displayed depending on which rule is fired ...

WPF ColorAnimation seems to retain part of original colour?

Hi guys, I'm having a strange problem with a colour animation. I have a list of items bound to a listbox. These items have an enum property which can have one of three values - NoRemarks, RemarksFound and RemarksUpdated. On the datatemplate for this listbox, I have a rectangle which displays a colour related to the item status - Red,...

How to set property only on second column of a ListView?

Introduction I have a ListView and want to format only the second column. The following XAML code does that: <ListView x:Name="listview"> <ListView.View> <GridView> <GridViewColumn Header="Property" DisplayMemberBinding="{Binding Path=Key}" Width="100"/> <!-- <GridViewColumn Header="Value" DisplayMem...

WPF Listbox is unbounded by the window

I'm working on a complex application, and I'm having an issue with a listbox not being bounded by the window height. Here's a simplified version of what it looks like. How would I get this listbox to correctly be bounded by the window? Right now, the bottom scroll button is off the screen and cannot be seen until the window is big enough...

How to edit a StoryBoard to put it in a Button Style ?

Hello, I've created a storyboard for a button in blend that I want it to apply everytime the button is pressed, So I tried to create a style,I've been stucked for a long time now. here is the code of my Storyboard: <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.S...

Generating Large Sets of Similar Windows in WPF

I'm hoping for some insight from someone better experienced than I for creating a window/set of windows for displaying data in WPF. Here is a little overview of my task: I will getting a large amount of binary output from a receiver. This will then be parsed and keyed to the meaning of the particular bit (i.e. word1 bit1 = Receiver St...

Linking IronPython to WPF

I just installed VS2010 and the great new IronPython Tools extension. Currently this extension doesn't yet generate event handlers in code upon double-clicking wpf visual controls. Is there anyone that can provide or point me to an example as to how to code wpf event handlers manually in python. I've had no luck finding any and I am new ...

How do I link (dependency) properties in my ViewModel?

Simplified example: I have an object that models a user. Users have a first name and a last name. The UserViewModel has a dependency property for my Models.User object. In the declaration of the UserView's xaml, I want to bind a couple of TextBlocks to the first and last name properties. What is the correct way to do this? Should I...

Problem using Blend 3 Interaction.Behaviours in VS2010

There seems to be a problem with support for the Interactivity namespace of Blend 3 in the VS2010 xaml editor. I have the following installed: VS2010 Blend 3 + Blend 3 SDK I am trying to compile a demo project that is targeted at .Net 4 Client Profile and has a reference to System.Windows.Interactivity (in the Blend 3 folder). In th...

VS2010 cannot find type ControlTemplate even though System.Windows is referenced

I'm trying to learn Silverlight here, creating a custom control template, however VS2010 refuses to recognize the ControlTemplate type in markup code, even though I have referenced the System.Windows and System.Windows.Controls assemblies (which is by default when basing the project on the standard Silverlight Application template). I'm ...

WPF Grid SharedSizeGroup error

If you run this code and click on tab 2 and then back on tab 1 the application goes insane and starts bouncing the column widths back and forth. Any suggestions on how to fix this? <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" ...

Is there a way to include XAML files in another XAML file?

I want to create a master XAML file which includes a bunch of other XAML files. Is this possible? ...

How can I get the x:Name of an object from code?

Given a reference to an object defined in XAML, is it possible to determine what (if any) x:Name the object has, or can I only do this by accessing the FrameworkElement.Name property (if the object is a FrameworkElement)? ...

Silverlight Project - Slide-in and out Panel - How?

I don't know what exactly this feature is, but I would like to simulate this in my Silverlight project. I am a C# developer and am moving to Silverlight and Expression Studio (Blend) for richer UX. Let's say I have some user controls and would like them to come into the screen (slide-in and out) as shown in the following site I found: ...

WPF binding problem

I've got a problem with binding in XAML/WPF. I created Action class which extends FrameworkElement. Each Action has list of ActionItem. The problem is that the Data/DataContext properties of ActionItem are not set, so they are always null. XAML: <my:Action DataContext="{Binding}"> <my:Action.Items> <my:ActionItem DataContex...

Starting out Silverlight 4 design

I come from mainly a web development background (ASP.NET, ASP.NET MVC, XHTML, CSS etc) but have been tasked with creating/designing a Silverlight application. The application is utilising Bing Maps control for Silverlight, this will be contained in a user control and will be the 'main' screen in the system. There will be numerous oth...