xaml

Does Mono support XAML?

Does Mono support XAML? Specifically I'm thinking of switching to using XAML for new GUI work that I do but also I like to keep my personal projects compilable in Mono. Should I just stick with plain old System.Windows.Forms for now? ...

x:Name attribute does not always create member or field variable

Adding an x:Name attribute to a XAML element normally results in a member variable being added to the backing class that can then be accessed using normal code. When the element in question is part of the DataTemplate, the field does not get created. I can sort of understand that the DataTemplate is making this a special case but can an...

What is the best way to reuse blocks of XAML?

I've got many user controls like this: PageManageCustomers.xaml.cs: public partial class PageManageCustomers : BasePage { ... } which inherit from: PageBase.cs: public class BasePage : UserControl, INotifyPropertyChanged { ... } Since PageBase.cs has no accompanying XAML file, I have to put the XAML that it refers to in each of...

Is it possible to use XamlReader from a XAML file to load in a block of XAML text?

I use the following DataTemplate in many controls: <pages:BasePageManageItems x:Class="TestApp.Pages.PageManageAddresses" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:pages="clr-namespace:TestHistorierung.Pages" xmlns:tk="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:x="http://schemas....

WPF: TemplateBinding to StrokeThickness of Shape does not work?

Looks like the following Ellipse in ControlTemplate does not get the BorderThickness, but why? <Window.Resources> <ControlTemplate x:Key="EllipseControlTemplate" TargetType="{x:Type TextBox}"> <Grid> <Ellipse Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHe...

Silverlight Dynamic Control not displaying

I have a simple control with code to add some paths. When I add my control to the control canvas, nothing shows up. To make sure that I wasn't crazy, I debugged through the code, and created a XAML equivalent and placed it off to the side of where my control should be showing up. I've tried changing the z-index and various Top/Left combi...

Why does my Custom UserControl's dependency property not work with binding?

My Custom UserControl's dependency property will bind correctly if the value is statically defined in the XAML calling it, like this: ItemTypeIdCode="addresses" but not if the value is bound dynamically itself: ItemTypeIdCode="{Binding ItemTypeIdCode}" What do I have to do to my custom UserControl so that it's dependency property r...

c# Layout problems with WF Subelements

Hi there, i have another layout problem. I have a WorkflowElement which contains other Workflow Elements: one fixed subelement and on the right side a horizontal List of subelements here goes my XAML Code: <Grid Grid.Column="0" Name="defaultGrid" > <Rectangle Grid.Column="0" Grid.Row="0" Width="2" HorizontalAlignment="Ce...

How can make all my user control dependency values load before they control accesses their values?

When I call this custom control, I have to put the attribute values in the correct order since the third dependency property (ItemTypeIdCode) accesses the values of the first two (KeyField, ValueField) to look up data in the database, and if they come after the first attribute, then their values are empty. <controls:DropDown x:Name="The...

Translate XAML EventTrigger to C# Code..

Can anyone tell me how this would look like in C#? <EventTrigger RoutedEvent="Button.Click" SourceName="btnSplit"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation From="0" To="1" Duration="0:0:0.25" Storyboard.TargetName="gridS...

Displaying ® symbol in Silverlight.

Folks! I am trying to display ® and superscript TM symbols in my silverlight app. I want to save the text containing the symbols in a resx file. Things i have tried: Copy paste the ® symbol from any document to resx file. ® symbol gets displayed in the resx file. But, when running the silverlight app, xamlparseexception ...

How to make simple combobox with selected value in XAML?

What is the correct syntax to select a combobox item with value (not index) in pure XAML? Doesn't work: <StackPanel> <ComboBox SelectedValue="CA"> <ComboBoxItem Tag="CO">Colorado</ComboBoxItem> <ComboBoxItem Tag="CA">California</ComboBoxItem> <ComboBoxItem Tag="NM">New Mexico</ComboBoxItem> </ComboBox> <...

Silverlight grid with auto width and height

Silverlight virgin here. How do I make the usercontrol surrounding my grid automatically resize to accomodate the grid width inside? Currently the usercontrol is displaying at about 300 or 400 pixels when the browser window is much wider. It renders both vertical and horizontal scroll bars around the data grid which is ugly. I want to se...

Embed a System.String in XAML

Is there a way to embed a string in XAML, give it and ID and refer to it later. I have tried: <Window x:Class="WpfApp1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" ...

IronRuby and Handling XAML UI Events

What it is the most brief and concise way of adding event handlers to UI elements in XAML via an IronRuby script? Assumption: the code to add the event handler would be written in the IronRuby script and the code to handle the event would be in the same IronRuby script. I'd like the equivalent of the following code but in IronRuby. Hand...

Disable a single wpf listbox item

Does anyone know if and how one can disable one or more listbox items in a wpf lisbox without disabling the entire listbox? Preferably I would have a DataTrigger which, when a certain Binding value is false, disables this item (make it impossible to select) while keeping other items in the same listbox active. <ListBox> <ListBox.Item...

How do I enable an element to paint outside its container?

I'm trying to get elements to render outside the bounds of their parent panel, in this case I'm using a stack panel. <StackPanel ClipToBounds="False" Width="200" Orientation="Horizontal" Height="50" Background="{DynamicResource TierBackground}"> <Rectangle ClipToBounds="False" VerticalAlignment="Bottom" Width="25" Height...

Rendering sharp lines in WPF

Hi all, If I render the following: <Grid> <Canvas SnapsToDevicePixels="True"> <Path Fill="#FF000000" SnapsToDevicePixels="True" Data="M 0.00,0.00 L 2.50,0.00 0.00,10.00 " /> <Path Fill="#FF260014" SnapsToDevicePixels="True" Data="M 2.50,0.00 L 7.50,0.00 2.50,10.00 0.00,10.00 " /> <Canvas.RenderTransform> <ScaleTransform Scale...

Binding to a single element inside a CompositeCollection

I am trying to produce a list of servers for browsing on a network such that it produces a tree view which looks like this: -Local Server - Endpoint 1 - Endpoint 2 -Remote - <Double-click to add a server...> - Remote Server 1 - Endpoint 1 - Endpoint 2 - Remote Server 2 - Endpoint 1 - Endpoint 2 My ViewModel looks like...

How can I know that a xaml is deprecated?

I was using the following xaml in wpf: <Style TargetType="{x:Type Border}"> <Setter Property="BitmapEffect"> <Setter.Value> <BitmapEffectGroup> <DropShadowBitmapEffect ShadowDepth="1"/> </BitmapEffectGroup> </Setter.Value> </Setter> </Style> When I discovered that DropShadowBitmapEffect is now deprecated in favour of Dro...