xaml

How do I copy a WPF resource in xaml?

I want to assign a resource I already have a second name, similar to using the BasedOn property of Styles. Specifically I have a brush that I use for a group of elements called ForegroundColor and I would like to use it in a control template (a ComboBox) calling it MouseOverBackgroundBrush. I would like to do something like this: <Resou...

ViewModel on top of XDocument

I am working on a WPF application which has a treeview that represents an XML. I load the XML on to the XDocument, then bind the TreeView to this object. Now using the MVVM pattern, I want to provide a ViewModel on top of XDocument. What are some of the things that I should implement in the ViewModel class. I am thinking of, Routed...

Loose xaml referencing versioned assemblies

I have a unique development situation and would like some input from others. I have a situation where I need to load loose xaml files within a rich client application. A given loose xaml file may have references to an assembly not currently loaded in memory so the referenced assembly is loaded before the loading the loose xaml. The loo...

How do you manage huge and barely maintainable XAML files?

I'm having real difficulties with XAML files in Silverlight since they get very big very fast when using Blend. It just becomes a wall of text after only a handful of controls are added and animated. I'm hoping a better vesion of Blend will come out soon, so that our designers will never even have to see XAML. For now, though, that is n...

Where is the Windows Workflow Xaml Vocabulary Specification?

I've been able to find Xaml Object Mapping Specification, WPF Xaml Vocabulary Specification, and Silverlight Xaml Vocabulary Specification documents online but no WF Xaml Vocabulary Specification document for Windows Workflows. I want to be able to specify workflows without using a Visual Studio IDE. Does anybody know if this specifica...

How do I use a WPF TreeView HierarchicalDataTemplate with LINQ to Entities?

I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties. It's for a hierarchy of Pages. This is handled in my SQL database with a ParentId foreign key in the Page table bound to the Id primary key of that same Page table. How do I display this hierarchy in a WPF TreeView? ...

WPF UserControl - cannot select TextBox

I have a really simple WPF UserControl: <UserControl x:Class="dr.SitecoreCompare.WPF.ConnectionEntry" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="connEntry" BorderBrush="Navy" BorderThickness="1" Margin="5,0,0,5" > <StackPanel Margin="0,10,0,0" > ...

How to use a different template for selected and drop down states in combo box in Silverlight?

I can't seem to set a ContentTemplate for a ComboBoxItem. There reason I'm trying to do this is I want to have 2 appearances for my data in the combo box. When the combo box is open (menu is down) I want a text box (with the name of the image) and an image control below it. When I select the item I want the combo box to just show a text ...

Disabling all but one control in a WPF window

I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome task on a background thread. When the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window -- Me.IsEnabled = False. I'd like to support cancellation of the refresh action by letting ...

VS2008 XAML design view chokes on namespaced C++ assembly

I have a C++ assembly with both managed and umanaged code compiled to a DLL. It is correctly imported into the project references as I can see all my classes and their members with the Object Browser. The problem is with the XAML Design view. In my XAML code I want to make a data bind with my C++ assembly so I have the namespace like s...

In WPF how do I specify the path to a file nested in a Directory using XAML?

I am trying to do this... <Image x:Name="imgGroupImage" Source="Images\unlock.png" Margin="0,0,5,0" /> But I get this error... Cannot convert string 'Images\unlock.png' in attribute 'Source' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'forms/images/unlock.png'. Error at object 'System.Windows.Hierarc...

Is there a way to bind the results of a public method in xaml.cs to a control in xaml?

Let's take a very simple example: In my window1.xaml, i have a label control named 'lblProduct'. In my window1.xaml.cs, i have a public method called CalculateProduct(Int Var1, Int Var2). CalculateProduct will, as you may have guessed, calculate the product of the variables passed in. I'd like to simply bind the results of 'Calculat...

How to add Icons to Treeview in WPF?

I would like to add some icons to my treeview. Is there a way to do it within the XAML? <TreeView Height="200" Name="treeView1" Width="120"> <TreeViewItem Header="Topic1" IsExpanded="True"> <TreeViewItem Header="Subtopic2" /> <TreeViewItem Header="Subtopic3" /> </TreeViewItem> </TreeView> ...

How do I keep the WPF GridSplitter from changing the size of my Grid?

WPF GridSplitter makes my Grid wider than my Window! I've got a WPF Grid with a GridSplitter. If I resize my columns, then I can make my grid wider than my window and non-viewable. It starts like this: But after widening the left column, I can no longer see the right column (green): What am I doing wrong? How do I keep the ...

Where to upload policies in the Oracle Entitlement Server

Where to upload policies in the Oracle Entitlement Server? ...

How do I keep aspect ratio on scalable, scrollable content in WPF?

I'm fairly new to WPF and I've come across a problem that seems a bit tricky to solve. Basically I want a 4x4 grid thats scalable but keeps a square (or any other arbitrary) aspect ratio. This actually seems quite tricky to do, which surprises me because I would imagine its a reasonably common requirement. I start with a Grid definiti...

Silverlight Control Template Color Property

I am creating a Control Template for the Button control in Silverlight 2. I started with an empty template and added the visual elements I wanted. The main visual element is just a path (shape) filled with a color. The button control already has a Color property associated with it and I was wondering if it was possible to link the Col...

How can I draw a concave corner rectangle in WPF?

How can I draw a concave corner rectangle in WPF? ...

How do I conditionally change properties of controls in the CellTemplate of a data bound WPF ListView?

Ok... I'm new to WPF, but I kind of know how to do things using DataTriggers and Converters. But, what I want to seems a little more complex than that. Let me give you the details: The DataContext for the ListView control is an IList of objects (object=Room). These are the available rooms. I've got another control (let's say it's a ...

How do I place/scale a XAML graphic in my application?

I'm working on a simple application to start learning my way around WPF. I created a vector graphic in Microsoft Expression Design at 400px by 400px, mainly because I thought it would be easier to create it on a bigger canvas. I've exported the image to a XAML file as a series of objects within a 400px square canvas. All of the child ob...