xaml

How to Add Custom Silverlight XAML Attributes !?

Is it possible to introduce 'custom' attributes into different UI Elements in XAML ? Also to read them later like we add attributes for server controls in ASP.NET ? I intend to read specific attributes and operate on them together. ...

XAML: Can I refer to a Grid row or column by name?

If I name each row and column in a grid, can I set a control's grid.row="Row_Top"? I have defined StaticResources to refer to it but is there a converter or some other method to accomplish this without the resource? ...

Do I always have to write a converter for date-formatting?

I often use textboxes in my wpf-projects which are bound to datetime-propertys. I want to format the dates into the german format dd.MM.yyyy. Currently I do this with a self-written converter, which I can give the needed dateformat. For example like this: <TextBox Name="Date" Text="{Binding RelativeSource={RelativeSource Mode=FindAnces...

Can I reassign from code an object declared as a resource in xaml?

I have a class for my data, MyData, and I'm accessing it in my gui by data binding. I decided to set the DataContext of the main panel in my window to an instance of this object so I could bind my various controls to it's members. So I could easily reference it in my xaml, I created an instance of MyData in Window.Resources like so: <lo...

wpf call method from xaml

Hi, How to call a call method from xaml in wpf? Thanks in advance ...

Textbox validation border

I currently have the following red border, signifying invalid entry, around textboxes in an application. It just doesn't look right to me, it has square borders around rounded corners and the drop shadow is the wrong colour. What is the best way of achieving a decent looking border around the text boxes? ...

VS2008 XAML Designer exception "Key cannot be null" when using default styles from a ResourceDictionary

I'm using a shared ResourceDictionary to define default styles and having major conflicts with the XAML Designer in Visual Studio 2008. Key cannot be null appears for all attempts to show the XAML design view. The dictionary is merged into App.xaml (to be used by all windows) and has a number of styles setting the defaults for controls...

WPF TabControl Position Tabs in the top right corner

I have a WPF TabControl that I want to position the tabs with a TabStripPlacement of Top, but I want them to display with a right orientation on top. I've achieved that easily by doing a FlowDirection of RightToLeft; however, I don't want the children controls to inherit the RightToLeft FlowDirection. Is there any way to position the ta...

Refactor DataTemplate (XAML) to reduce duplication

I have the following datatemplates: First One: <DataTemplate DataType="{x:Type WIAssistant:DestinationField}"> <ContentControl Margin="5" MinWidth="60" MinHeight="70" > <Border BorderThickness="2" BorderBrush="Black" CornerRadius="5"> <!--This text block seems un-needed. But it allows the whole control to be dr...

WPF ListView GridViewColumn Double Click

Hi, I have a WPF ListView that opens a certain window when double clicked on a certain item inside the list view, but I have a problem. When I double click the GridViewColumn, that also opens up a certain window. Is there a way to detect if the sender is a gridviewColumn or a listView item? Thanks ...

WPF XAML resources

Hello, I would like to place some WPF Data Templates in a loose file that I can reference where needed in my UserControl. I do not want the Data Templates to be application wide (use app.config), I only want it to be specific to my library. Is there a way to do this besides placing the Data Templates in UserControls and then loading the...

How to use MultiBinding in a WPF ComboBox

This is driving me NUTS!!! I have a ComboBox used to filter a query by employee which works fine but only displays the employees first name. I want to use a MultiValueConverter to display the employees full name (This would be less urgent if we did not have 2 Mikes and 2 Daves) Below is my working code and the IMultiValueConverter Clas...

Silverlight / Deepzoom weird flashing rectangle bug

Hi there, I just launched my website - blackspike.com - under the 3D tab on the homepage I've put a deepzoom collection in there. A friend has noticed that if you pan down and to the right there's a weird psycadelic flashing rectangle. I've tried recreating the collection, and reuploaded and there is nothing in the composer project to s...

WPF Toolbar Items HorizontalAligment="Right"

Is it possible to make the elements within a WPF toolbar have a HorizontalAlignment of Right? <ToolBar Height="38" VerticalAlignment="Top" Grid.Row="1"> <Button HorizontalAlignment="Left" Width="50" VerticalAlignment="Stretch"/> <Button HorizontalAlignment="Left" Width="50" VerticalAlignment="Stretch"/> <ComboBox Width="120"...

DataTemplate enum

Greetings, I'm developing my application in WPF. My users are of different types: Client and SUpplier. I would like to display some information - different for each user. I have a Property called called OperatorType which is OperatorTypeKind enum. How can i create different DataTemplates in xaml for Client and Supplier ...

WPF: Using an image converted to vector graphics in a XAML.

I converted image.png to image.svg using Vector Magic and then to image.xaml using svg2xaml, which according to this is supposed to work with Visual Studio. After adding image.xaml to the project and setting its build path to resource, I add the following line to my XAML file: <ContentControl Template="{StaticResource image}" /> Acco...

'Quick Text' editing like in MS word - WPF

I want a special TextBox (May be RichTextBox) in to which I need to type lot of text and predefined fields. When I enter a special char '[' I need to get a VS like intellisense popup and mark the inserted text in a special manner like below So please suggest me a way to make the inserted field selectable as in word. so the double clic...

How to Bind the Cursor property of a Grid to a Property of my ViewModel in Silverlight 3.0?

I'm attempting to bind an IsLoading property to the Cursor property of my UI's LayoutRoot Grid. I'm trying to have the main app cursor become an hourglass whenever the property says it's loading. I'm binding the property as follows: <Grid Cursor="{Binding IsLoading, Converter={StaticResource CursorConverter}}"> The key "CursorConvert...

Why wont my inner control center in my ItemsControl?

<Window x:Class="Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" xmlns:System="clr-namespace:System;assembly=mscorlib" Title="Referee" MaxWidth="800" MaxHeight="600" > <W...

Smooth transition from image to image

Here is my XAML: <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Image x:Name="Expander_Normal" Source="/Images/arrow-e.tiff" Width="13" Height="13" /> <ControlTemplate.Triggers> <Trigger Property="ToggleButton.IsChecked" Value="True"> <Setter x:Name="Expander_Expanded" ...