xaml

Xaml to Image to print, high quality prints.

Hi A few questions about printing from xaml: We are generating gif images for printing from existing xaml. The gif images are used for printing. The issue we have is the images are not looking good after printing. One issue is text is coming up blurred when we print on different sizes such as A3 & A4. The same issue is with the image...

Wpf Recursive Binding

I'm trying to figure out how to build a recursive binding in xaml. I know about HierarchialDataTemplate, but that's not what I want, because my data source is not a collection of items. Specifically, I'm building an exception browser, and am trying to figure out the best way of expressing the exception's InnerException field (which is of...

TypeConverter for generic type used in xaml

I am looking into initializing members of generic types declared in XAML. This is targeting the (reduced) generics support in WPF 4 and future Silverlight. (I have tried the scenarios below using x:TypeArguments and XamlReader.Load in VS2010 Beta 2, but will use TestClassInt32 : TestClass<int> { } for simplicity, as it has the same behav...

creating a HierarchicalDataTemplate in Silverlight with code

I'm trying to create a HierarchicalDataTemplate (from the Silverlight Toolkit) in code in Silverlight following this advice on creating DataTemplates from code: http://stackoverflow.com/questions/59451/creating-a-silverlight-datatemplate-in-code. However, I haven't been able to get it to work for HierarchicalDataTemplate. I tried using ...

Horizontal ListBox items layout problem.

I have horizontal ListBox. Here is code for it (removed some irrelevant): <ListBox Grid.Row="1" ItemContainerStyle="{StaticResource ListBoxUnselectableItemStyle}" ItemsSource="{Binding ...}" BorderThickness="0" Background="{x:Null}" ...

How do you insert a row/column in a WPF Grid?

Anyone have any suggestions on how to insert a row or column in a WPF Grid using (preferably) Visual Studio 2008? It's no problem to add a new RowDefinition or ColumnDefinition, but I'm really not too excited about the prospect of incrementing the Grid.Row or Grid.Column for the large number of cells that are affected by the insertion. ...

'Element is already the child of another element' error in Silverlight App.xaml

Hi, I keep getting a strange error inside my App.xaml file: Element is already the child of another element. My App.xaml file looks like this: <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Celerior.Annapurna.SL.A...

Error when adding code behind for Silverlight resource dictionary: AG_E_PARSER_BAD_TYPE

Hi, It should be possible to add a code behind file for a resource dictionary in Silverlight, but I keep getting the same error, thrown from the InitializeComponent method of my App.xaml constructor: XamlParseException: AG_E_PARSER_BAD_TYPE. The resource dictionary xaml file looks like this: <ResourceDictionary xmlns="http://schem...

WPF Programming Examples (Photo widget)

Anyone know (or can provide) a programming/XAML example with WPF of a image collection widget similar in principle to that of Picasa? ...

Bind to ancestor of adorned element

Hi there! Here is the case: <DataTemplate x:Key="ItemTemplate" DataType="local:RoutedCustomCommand"> <Button Command="{Binding}" Content="{Binding Text}" ToolTip="{Binding Description}"> <Button.Visibility> <MultiBinding Converter="{StaticResource SomeConverter}"> ...

How to bind a TabControl to an ObservableCollection in XAML

I have the following line of code in my code-behind class. TabControl.ItemsSource = ((MainWindowViewModel)DataContext).TabItemViewModels; I would like to move this to the XAML file. In brief, There is a MainWindow class representing the main-window. There is a TabControl placed on the main-window. There are 2 view-models called Mai...

Xaml in WPF to tiff or eps.

Hi I am wondering if it is possible to create tiff/eps image from xaml in wpf. We are looking for printing high resolution images from existing xaml in wpf. Please let me know if you have any suggestions. Thanks N ...

Bind Button.IsEnabled to custom validation with XAML?

I am sorry I didn't know how to title my question any better, you name it if you got a good 1. I have an entity Contact. this person has navigation properties: Address, Phones (A collection of Phone). They all implement a custom interface that exposes a property IsValid. In the contact edito form I have an OK button, I want its IsEnab...

Getting Unity to Resolve views in XAML

I'm starting out with MVVM, and I'm starting to understand things. I'm currently experimenting with the Cinch framework, though I'm not committed to it as of yet. I was injecting the ViewModels into the Views using by having a reference to the ViewModel in the codebehind of the view, with the property having a [Dependency] on it, and in ...

WPF Image won't display BitmapSource

I'm new to using WPF and GDI, and I'm having trouble displaying an image. My eventual goal is to build something expose-like. So far, I gray-out the screens, gather all the active HWNDs, and capture the screens of all the windows. For now, I have a single Image element that I try to set the source for, but nothing ever shows up. foreach...

XAML, giving full width and height to my text

Hi, I have a grid with 3 rows, in my top row (200px height) i want a text on a blue background. How do i specify that my textblock should fill the space? when i add it it only fits the space the text occupy. Tried with a ViewBox, but that resized the text also, i want that to be a fixed size... anyone? ...

How to disable ScrollViewer in ListBox?

I have a ListBox. It has internal ScrollViewer, so I can scroll ListBox content with mouse wheel. It works fine until I set item template that contains another ListBox (in fact, I have 4 nested ListBoxes =)). Problem is that internal ListBox's ScrollViewer steals wheeling event. Is there any easy way to prevent this behavior? I had Li...

How do I programatically fire a command

i have an ICommand that I want to fire (make the execute go) from code; how do I do this? ...

Create and place an Image in WPF

Hello, It's simple enough to define an image in xaml and move it around, but how would I do this programmaticly? I define my Image like this: System.Windows.Controls.Image imgpanel = new System.Windows.Controls.Image(); imgpanel.Source = loadBitmap(capwin); And I'd like to be able to set it on my window. How would I got about this? ...

Hierarchical Data Structure WPF TreeListView

Hi! I am currently writing a WPF TreeListView. I was wondering a couple of things. How does the Hierarchical Data Structure work and can the children display other properties instead of the same property as the parent? Currently I am trying to make a treelistview with the columns Client / Matter / Hours If i add a client and it ha...