xaml

Exception with type System:Char

I am trying to create a reusable System:Char value in my xaml resources. I have: xmlns:s="clr-namespace:System;assembly=mscorlib" Then: <s:Char x:Key="MaskPromptChar">#</s:Char> I get an exception: The type 'Char' was not found. [Line: 8 Position: 44] But... I also have: <s:Double x:Key="DefaultControlWidth">200</s:Double> ...

Can you bind a whole object to a CommandParameter in XAML?

I have a linkbutton inside a listbox that receives a list of objects. I'm using the ListBox.ItemTemplate and DataTemplate to lay out the listbox items. Can I bind the entire object that is currently binding to the command parameter of the linkbutton? I've tried using CommandParameter={Binding Data} and CommandParameter={Binding ...

XAML and UI Development

I've been given the task of coming up to speed, at least at a basic level, with WPF. I'm going through the WPF 4 Unleashed book. The first part of the book is going through XAML. My questions are these: Do people really design their forms using pure XAML (manually creating XAML code)? The only thing I can think of that might be more ...

Questions related to Installing Silverlight on Mac

We are planning to develop a Silverlight 'cross platform' application, that is expected to run on both Windows and Mac with elevated permissions. Mono alone is not an option, as the application requires Silverlight specific video features, supported only in SL 4.0 So, here are some considerations. 1 - The 'Application', should interfa...

Redrawing silverlight accordion item not working

I have a datagrid in an accordion that I programmatically add items to. The items don't have a problem being added, but the accordion item doesn't refresh to a size that can view all the contents of the datagrid. If I drag the datagrids sides to resize it, the accordion item resizes correctly. I can't seem to do this automatically thr...

WPF XAML code-behind management

Hello there... I have wandered into a WPF application project and have made some good progress, but one thing I am finding is that the code-behind page is now getting longer and longer... since there is only one XAML page to the whole application, the code-behind page that really just takes care of the event handlers and programmatically...

WPF Datatrigger for an item template

I have the following xaml inside a text box element that is part of a combo box item template. The combobox's items source is set to a list of objects that have a boolean property AcceptsInput everything works great but I can't get this trigger to fire do I have to do something else. <TextBox.Style> <Style TargetType="TextBox"> ...

How to customize the UI display of a list item?

I want to add a prefix and surfix gradient panel to decorate the items in a list. I'm new to custom control and need a started point to do this. Please show me how to do it. ...

WPF RightClick MouseBinding on release?

How can I enable a mouse binding to the release of the right button? At the moment I have the following code in xaml which is linked to closing the wpf window. The problem here is that because it reacts to the rampup of the click when closing the window it activates a context menu on the desktop. <MouseBinding Command="Close" MouseActio...

Problem with XmlDocument deleting import prefixes.

I create a xml document and try to get the string out of it like this: string path = "c:\temp\window.xaml"; FileStream stream = new FileStream(@path, FileMode.Open); XmlDocument doc = new XmlDocument(); doc.Load(stream); string insideString = doc.FirstChild.OuterXml; Here is the content of a window.xaml file: <Window xmlns="http://...

how to make a xaml control with different view modes

I'm trying to learn how to separate a view from its associated viewmodel, while making the view have as little or no code-behind as possible. my control has a textblock when the object is in a display mode, and a textbox when the user wants to edit that field. In both cases, these controls must bind to the same string in the modelview,...

Silverlight Dataform: "Save" and "Edit" buttons not showing up

I'm trying to make a data form in Silverlight 4. Perhaps I'm doing something wrong. The class: public class ExpenseInfoTest { public int MyProperty { get; set; } public int Foo { get; set; } public int Bar { get; set; } } XAML: <local:ExpenseInfoTest x:Key="newExpense"/> <df:DataForm Height="218" ...

Help creating a Control

Hello every body, I'm trying to create a Watch Control and dont realy know where to begin. My goal is to able do declare a watch like this. <Watch Shape="Round"> <WatchButton Watch.Angle="70"/> <WatchButton Watch.Angle="90"/> <WatchButton Watch.Angle="120"/> <Cadran Shape="Round"> <Needle/> <Needle/> ...

How to size a navigation page

Using the Silverlight Navigation Project template, I would like the content my Pages to be horizontally and virtically centered in the navigation frame, and not fill the whole space. For example, consider this piece of XAML placed Home.xmal view. What this results in is a rounded corner beige background that fills the whole frame with ...

How do I create a two-way link the SelectedItem property of a ListView ?

Hi, I've recently taken over a MVVM project started by someone who's now left the company; It's my first time using WPF, but by the looks of it, it was his first time using both WPF and OOP... Anyway, I've got a ListView in the XAML, and I've got a collection class which doesn't currently contain a "SelectedItem" property. Can someon...

How to use Dataset desgner and Data Sources windows with WPF and XAML in vb.net 2008?

More moans about WPF: As it seems generally likely that MS are going to get rid of Windows Forms (sooner or later), and I am informed by the same organisation that WPF is 'cool', just exactly how can I use the wonderful graphical data toolset in vb.net 2008? I understand the basic concepts of creating table adapters and multiple queries...

What does 'ItemsSource="{Binding}"' mean?

Hi, I'm attempting to learn WPF by unravelling a frankly nightmarish project written by the guy who was in this job before me. Sorry if some of my questions are pretty much homework-level but I'm trying to work out what existing XAML does, with an insufficient understanding of the concepts behind it... Anyway, I have a ListView with th...

How much slower is dynamically loading XAML versus a compiled WPF app

i am trying to find a good document to understand the performance differences and whats happening under the hood when comparing a compiled WFP windows app versus trying to load XAML dynamically. any suggestions ? ...

How to use enum value to set header for a tab item of a tab-control?

I want to get the header of a selected tab-item of a tab-control and activate another tab-item of another tab-control appropriately, eg. select tab "A"/"B" of tab-control TC1 will activate tab "A"/"B" on tab-control TC2. I want "A", "B", ... to be a enum value so that no string comparation is used. So, how can I use an enum value to se...

Why keep code behind 'clean' and do everything in XAML?

What is the benefit of keeping code behind 'clean'? Many times I come across posts here about someone trying to do the equivalent in XAML instead of code behind. Their only reason being they want to keep their code behind 'clean'. Correct me if I am wrong, but is not the case that: XAML is compiled too - into BAML - then at runtime h...