xaml

How to write a value object in XAML using markup extension?

I want to replace <Button Text="Foo" Command="{Binding Foo}"> <Button.CommandParameter> <System:Boolean>True</System:Boolean> </Button.CommandParameter> </Button> with something like <Button ... CommandParameter="{???}"/> ...

WPF binding based on comparison

There is a relatively simple thing I'm trying to achieve but I'm unsure how to do it. Basically, I have a CLR class as follows: class SomeClass { public SomeEnum Status; } public enum SomeEnum { One, Two, Three }; I've got a DataGrid that I'm binding an ObservableCollection<SomeClass> programmatically through the code-behind. In ...

Windows Workflow Foundation 4.0 Break Out of ForEach<T> Activity

I'm using Visual Studio 2010 Beta 2 to get a head start on learning to use WF4. I'm working in the designer to create a xaml file. I've added a ForEach activity, and inside that ForEach activity have a flowchart that does some conditional processing. I want to be able to break out of the ForEach if one of the conditions is true, but c...

<ContentControl>Content</ContentControl> vs. <ContentControl Content="Content"/>

Given the following two options: <ContentControl>Content</ContentControl> vs. <ContentControl Content="Content"/> Any performance differences? What would you say is more readable? Conclusion? I'm affraid this question might sound somehow babyish, but how will I know if I won't ask, so I decided to shoot it. Comment me if I chose...

Unable to implement ICommandSource in VB

Hello! Has anyone ever tried to implement ICommandSource with VB? The examples provided by Microsoft are in C#, and since VB doesn't allow implicit implementation this interface is like inachievable in VB!! http://msdn.microsoft.com/en-us/library/ms771361.aspx ...

Treeview databinding to a DataTable

Hi, I am new to WPF and would really appreciate help on an issue Im struggling with. I need to Bind a treeview Item in a WPF treeview in the main app's Menu. All i need is the correct syntax to bind the single datatable to treeview item(XAML and the codebehind) this is what I have so far. Please provide code with your suggestion, y...

Error using ResourceDictionary in Silverlight

In my Silverlight app I have UserControl and I want to reference a StaticResource in a ResourceDictionary that is in a separate XAML file. My UserControl looks like this: <UserControl x:Class="ResourceDictionaryHeadache.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsof...

WPF Grid with XmlDataProvider and ContentControl?

What is wrong with DataTemplate x:Key="CellTemplate" not reaching the DataContext of the Grid's ContentControl? <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication1.Page1"> <Page.Resources> <XmlDataProvider x:Key="x...

Insufferable word wrap in Visual Studio XAML editor - is there any relief for 2010?

Just curious if the XAML editor is any better at auto-formatting and wrapping attributes in Visual Studio 2010. Here's how the editor auto wraps attributes in VS 2008: <StackPanel Grid.Row="0" Grid.ColumnSpan="3"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center" FontWeight="Bold" Text="Current Use...

Unhandled Exception in XAML - How to solve ?

Hi, Please help me to understand the problem and solve this: Thanks ! ...

Xamly begin a storyboard when a RoutedCommand is called?

Is there a way to begin a storyboard wen an ICommand is executed WITH XAML? ...

If I need to have 60 Image controls in my appplication, am I going to necesarily have 60 of these huge code blocks?

Someone suggested this for me to use as an animation: <Window x:Class="WpfApplication.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="600" Width="600"> <Window.Resources> <Storyboard x:Key="ScaleImageStoryboard"> <Double...

Creating a reflection of a WindowsFormHost in wpf

I am very new to WPF and I am a bit stuck. I'm trying to create a demo program that displays several embedded win forms applications. I'd like to add a reflection of the form, but most of the existing tutorials I've seen seen for image reflections do not work. If anyone can point me in the right direction I would really appreciate it. H...

Access XAML Instantiated Object from C#

In my XAML I declare an instance of a class called DataConnection, the instance is named MyConnection. <Window.Resources> <!-- Create an instance of the DataConnection class called MyConnection --> <!-- The TimeTracker bit comes from the xmlns above --> <TimeTracker:DataConnection x:Key="MyConnection" /> ...

XAMLParseException driving me CRAZY!

THIS XAMLParseException IS DRIVING ME CRAZY!! I am using .NET 3.5 in Visual Studio 1020 This is my xaml: <Window x:Class="WinformsHost.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Advanced Notepad" Height="350" Width=...

custom drawn wpf / xaml textbox

I'm looking for a textbox control(and or combo box) much like the IE or FireFox URL bar, as in i can pass it an image for the left side, and can get a styled combo box drop down instead of standards. And if there isnt, can i be informed on a good way to write the control myself? ...

WPF Tiled Background Misalignment

We have quite a complex WPF application (that I cannot show here) that somehow has the tiled background misaligned of one of its user controls. I was unable to reproduce this problem in a "clean" WPF project but will try to illustrate the problem in this picture: The gray area represents the user control and the black and red checks r...

XAML - MergedDictionaries throwing XmlParseException "item has already been added". Why?

hi all, I have the following, very easy to reproduce problem: I'm creating a xaml application which uses resources from another file. The way to go is to create a MergedDictionaries-tag to merge the local and global resources, like this: <Window> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries...

How can the Silverlight BarChart's origin (X, Y = 0, 0) be set to the upper-left corner?

I have a Silverlight Chart with a BarSeries, with the bars set horizontally. The data origin starts in the lower, right corner. The source data is also bound to a ListBox. The sorts appear different on the screen when comparing the Chart and ListBox. Here is an example of what it looks like: Chart Item4 ======== Item3 =====...

XAML Controls offsetting themselves, becoming invisible in Blend and browser

I'm having a problem, visible at runtime and in Expression Blend, where the text blocks (not text boxes, buttons, or custom controls) in my layout grid keep pushing themselves outside their cells, rendering them invisible. If I touch any of their properties in Blend (such as incrementing and then decrementing one of the margins), they be...