xaml

CompositeWPF - MVVM - How to change the focus and tabnavigation to an element in view

Using CompositeWPF I have the following setup: <Window x:Name="MainWindow"> <View x:Name="MainView"> <View x:Name="CurrentSelectedView"/> </View> </Window> MainView is a view containing a menu structure. CurrentSelectedView changes depending on the menu selection you make. For this example lets assume the CurrentSelectedView c...

Weird change in behaviour of Attached Properties between Silverlight 3 and Silverlight 4

I've encountered a strange problem while upgrading an application from Silverlight 3.0 to Silverlight 4.0. The XAML below used to work fine but after upgrading no longer works. <xxx:FeatureGrid.Columns> <agDataGrid:AgDataGridColumnCollection> <xxx:FeatureGridTextColumn FieldName="HOUSE_NUM" HeaderContent="Number" /> ...

Can you data bind when your XAML is loaded at runtime?

I am loading some XAML pages that I have created that have some data binding in them. However, when I load these XAML files at runtime their data binding no longer works. I'm wondering if it's some kind of scope or pathing issue or if you just can't do it. Here is how I am loading the XAML using (XmlReader rdr = XmlReader.Create(@".\Tw...

Display strings from array in a textboxes that are in different xaml WPF

Hello! So, I got a 10 element array and I want to display those elements in a 10 textboxes that are in different xaml file and are created as a child of stack panel. How do I do it? Thanks in advance. ...

How do I specify common layout markup or rules for controls in XAML?

I'm a WCF newbie, and I wonder, is it possible to declare in XAML that all my TextBoxes should have a height of 26, for example? That is, not to set the height of each item individually? ...

DataGridComboBoxColumn with different ItemsSource for editing

I have a datagrid with two DataGridComboBoxColumn. The DataContext for the datagrid is set in the code behind as the DefaultView of a DataTable. This includes the two columns I want the combo boxes for so I can store the selected value in the DataTable and ultimately write it back to the database. I want to have the ComboBoxColumn dis...

Display WinForm Image in WPF application

I have a dll with quite a bit of System.Drawing.Image resources that I have wrapped into static properties so I can update them dynamically. I would like to use the images through xaml in a WPF application, but the only way I can figure is to do it through the code behind manually. Is there a way to do the winform to wpf image converti...

Wpf FixedDocument Canvas Reuse

I'm converting Xaml code to Xps but i can't use a canvas in a merged dictionary as Background of all the pages in a FixedDocument, because it throws an error on the second page. The error say that the Canvas is already in use and i need to disconnect it. I'm triyng to avoid putting a resource for every page because the resulting xps wil...

WPF Web application: How to embed in ASP.NET page ?

I am trying to bulid a WPF web application.I have 2 projects in the solution .One is of type WPF web application and another is of type ASP.NET web application where i need to embed the WPF stuff.The XAML file runs file when i set startup project as the WPF web app project.How can i add/embed this into the Default.aspx of my ASP.NET Web ...

How do XAML files associate with cs files?

It seems that XAML files should have corresponding .cs files in a C# project. I know Visual Studio does all the things for us. I'm just curious how they are linked together? I mean, are they specified in the project file, or just because they have the same names? And also, App.xaml file specifies the startup file, but how does the compil...

Window manipulation and inctences control

In my application there are only 2 windows — win_a & win_b, on each of these windows there is button that call another window, e.g. click on btn1 of win_a will call win_b, click on btn2 of win_b will show win_a. Desired behaviour: 1. Only one instance of object is premitted at the same time, e.g. situation, where 2 instances of win_a ru...

WPF dynamic layout: how to enforce square proportions (width equals height)?

I'm learning WPF and can't figure out how to enfore my buttons to take a square shape. Here is my XAML Markup: <Window x:Class="Example" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="368" Width="333"> <Window.Resources> <St...

Show elipses where text will be truncated as per iTunes

I a building an application with a similar layout to iTunes i.e. it has a sidebar that doubles as a menu. Some of the text will exceed the boundary and rather that having it be truncated I would like to show ellipses (see line image below "Purchased on My iPh..."). How would I go about this in WPF? Suppose I made the boundary movabl...

Xaml Namescope and Template Question Concerning WPF ContextMenu

Everything in the code below works except for the binding on the ContextMenu. This is evidently due to the fact that the ContextMenu is located inside of a Style, which puts it in a different namescope from the rest of the xaml. I am looking for a solution where I won't have to instantiate a ContextMenu in the code-behind, since the ap...

XAML Binding to complex value objects

I have a complex value object class that has 1) a number or read-only properties; 2) a private constructor; and 3) a number of static singleton instance properties [so the properties of a ComplexValueObject never change and an individual value is instantiated once in the application's lifecycle]. public class ComplexValueClass { ...

Wait for animation, render to complete - XAML and C#

Hi all. I have a situation where I am animating part of my XAML application, and I need to wait for the animation AND rendering to complete before I can move on in my code. So far the tail end of my function looks like: ProcExpandCollapse.Begin(); while (ProcExpandCollapse.GetCurrentState() != ClockState.Stopped) { } } Which...

Are there any FREE Xaml Diff/Merge tools available?

I am searching a free diff tool with support of native syntax and markup for XAML, but failed to find one. I like Altova's DiffDog but it's paid. CodeCompare is an useful tool. It has some worth with its integration into VisualStudio and usage of native editors. It's a perfect solution for XML! However, it does not support XAML editors. ...

Is there any easy way to hide the radio buttons, checkboxes, etc. without hiding the content?

I'm suspecting the answer is no, but I just want confirmation before I move on - is there any easy way (as in, not re-templating) to hide things like the box that gets checked on a CheckBox, the drop-down arrow of a combo box, etc. without hiding the actual content being displayed? ...

Silverlight 4 RichTextBox - can't restore Xaml with text containing curly braces

We have a Silverlight application using the RichTextBox as a rich text editor for the user to create emails. We actually have our own serializer but essentially we are saving and restoring the Xaml. As far as I can tell it is impossible to restore any text containing curly braces. You can demonstrate this fairly easily by creating a Ri...

Alternative to ZAM 3D editor for Windows 7

I'm looking for some 3D editor that allows to create 3D objects and export them to XAML format. Because I'm under Windows Seven ZAM 3D editor is no option for me. I need to create relatively simple(but good looking) 3D objects, no game animations. I prefer simple and intuitive GUI, so Blender is no option for me... It would be good if ...