xaml

Why is XamlWriter not considering ContentProperty attribute?

I'm trying to use XamlWriter to write custom objects to XML. I'm trying to do this because I find the default XmlSerializer a pain because of BindingFailures, missing XmlInclude, etc. So far I'm pleased with how clean the XamlWriter writes to XML and how it worked with no changes to my data classes. For example, here's the output of my...

WPF/Silverlight XAML template for a glass button

It seems like a simple thing - but... I want to create a WPF/Silverlight XAML template for a glass button that contains an image and a label - both the image and the label use template binding so that different images and labels can be specified for each button instance. Any help would be appreciated. David Roh ...

Autosizing ComboBox dropdown to content in Silverlight.

I have this ComboBox in my Silverlight UserControl: <ComboBox AutomationProperties.AutomationId="cmbProjects" Grid.Row="0" Grid.Column="2" ItemsSource="{Binding Projects}" SelectedItem="{Binding SelectedProject, Mode=TwoWay}" Style="{StaticResource Defau...

applying function on a value returned from MarkupExtension in xaml

Is there a way to apply a function on a value returned from a MarkupExtenstion such as {Binding ... } or {StaticResource ...} in XAML? Usage example: making the font size of button1 to be twice bigger than the font size of button2? ...

XamlWriter fails to serialize objects in WinForms app

Apparently XamlWriter doesn't works correctly in a WinForms application. XamlWriter uses MarkupWriter.GetMarkupObjectFor(object obj). I suppose that there's a problem to determine the full list of properties to serialize. var ar = new AssemblyReference(AppDomain.CurrentDomain.GetAssemblies().First()); var str = XamlWriter.Save(ar); Ru...

How can a custom type loaded through XAML obtain a reference to the root object

I am attempting to use XAML to represent and load a graph of custom types that form a semantic model for a business domain. One thing I would like to do is to be able to obtain a reference to the "root object" of the graph from an object deeper in the tree. I cannot find any straightforward way of doing this other than resorting to ba...

XAML Binding Properties

Hi,Can someone point me to some sort of documentation that has a complete list of the properties and their value types that Binding class offers. <Image Source={Binding ......}/> Basically a list of all the properties that go after the Binding keyword. Many Thanks ...

XAML - Text over semi-transparent background

This must be so simple but I can't do it: if I put a textblock in a container and make the container opacity < 1, the text inherits that opacity, no matter whether I try to override it in the textblock. How can I keep the text 100% opacity while in a semii-transparent container? <Grid x:Name="LayoutRoot"> <Border Background="red" O...

Silverlight user control vanishes in designer

I am writing an application in Silverlight that is supposed to retrieve weather data from Google and then display it. I was working on the layout in XAML and was going to see how it looked in the designer, but when I switched to the designer pane, a small notice said that an assembly had been updated, so I clicked it, and the user contro...

WPF + IoC: "Specified Visual is already a child of another Visual or the root of a CompositionTarget."

[Edit: Rethinking architecture along mvvm lines made this problem largely fall away - thanks @kent] Using Spring.NET + WPF. Load two WPF buttons in the config: <object name="Button1" type="System.Windows.Controls.Button, PresentationFramework" > <property name="Name" value="Next" /> <property name="Width" value="200"/> <property...

VS2008 Xaml Editor is totally unstable

I have installed every patch I can find that deals with stability. I have turned off intellisense in the XAML Editor. I have setup XAML to only use the XML View (I never use preview). VS2008 crashed multiple times an hour while editting XAML. It is fine until the first time I open up a XAML file and then it is only a matter of time b...

Attempted to read or write protected memory.

I am trying to learn WPF. I am following along with a book(WPF in 24 hours) and occasionally I get the following error: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted. When I click "OK" the application continues to run as if nothing is wrong.So far I have worked with XAML o...

Any good Expression Blend Tutorial out there??

Hi, i want to learn Expression blend.. ive been reading some blogs.. about it.. but the applications are some what hard to follow cuse i haven't had a crash course on Blend.. any good tutorial to learn the basics?? i think i need to learn XAML first..what do you recommend? ...

Silverlight 2 dynamic data binding Converter

In Silverlight 2.... I have a RadioButton in my xaml code as follows: <RadioButton GroupName="Gender" Content="Male" IsChecked="{Binding Path=Gender, ConverterParameter=1, Mode=TwoWay, Converter={StaticResource RadioStringConverter}}" Width="49" HorizontalAlignment="Left"/> This works great. My issue is in trying to duplicate this f...

How do I bind to the SelectedItem property in a ControlTemplate?

Consider the following Control/Template <my:ExpandingListBox Margin="0,2,0,0" x:Name="TagSearchListBox"> <my:ExpandingListBox.Template> <ControlTemplate TargetType="{x:Type my:ExpandingListBox}"> <Border Name="MyBorder" BorderThickness="2" BorderBrush="Black"> <Grid> <TextBlock...

VS 2008 designer not installed for xaml

there is no editor for c:......\Page1.xaml please make sure the application for the file type (.xaml) is installed no idea what the issue could be. i tried to find devenv.exe but i can't find it anywhere!! i have installed sp1. i have also completly uninstalled vs2008 and .net framework 3.5 and reinstalled it. did not solve it. some ...

WPF bind control size

I have a StackPanel with a list of custom user controlls that I would like to resize. I would like the user to be able to drag a slider and scale the control size up and down. Is there a way to bind the control width to a slider value? Something similar to: <MyControl Width="{Binding Path=SizeSlider.SelectedValue}"/> Is this possible...

How to propagate errors & exceptions that occur during WPF data binding?

Every so often I find that I have accidentally broken data binding in my application. Either by renaming a property and not renaming it in the XAML or by a property throwing an exception for some reason. By default data binding errors are logged to debug output and exceptions that are thrown are caught and suppressed. Is there an easy...

How can I make this Xaml a Template?

Without using code, how can I turn this into a Template? I have about 10 of these, and my code is getting huge. It is working perfectly, I am just looking for ways to clean up the code, I am just not familiar enough with templating and resourcing animations and triggers to do this. Thanks in advance. <RadioButton Width="35" Height="3...

Silverlight Dynamically sized table

I'm very new to Silverlight so I apologise if this question is obvious but I want to create something similar to a HTML table that can have any number of rows from 1 to x. I need the table to grow with the number of rows added to it. Additionally, I would like to be able to set the width and height of the table as a whole and have all ...