xaml

WF4 RC - Cannot create unknown type when loading WF Service from loose Xaml with ActivityXamlServices

Hello, I am trying to host a WF4 (RC) Service dynamically. I have a test solution with two projects. The first is a declarative workflow service library with one root Flowchart activity in it, and a simple custom code activity. The workflow service library does not depend on any other custom assemblies or references. The second is my ho...

Can't access font resource in Silverlight class library

I have a reasonably large Silveright 3.0 project on the go, and I'm having issues accessing a couple of custom font resources from within one of the assemblies. I've got a working test solution where I have added a custom font as a resource, and can access it fine from XAML using: <TextBlock Text="Test" FontFamily="FontName.ttf#Font Na...

Trigger Property on another WPF control event

Suppose I have a ListView and TextBox and they are located in different containers in the same Window. Selecting items in the listview I want the TextBox Text property to be updated in accordance with the listview data bound selected item. Is it possible in XAML? ...

How to set an Image fit to width of ScrollViewer

I've Image placed inside a ScrollViewer. <ScrollViewer x:Name="imageScroller" Grid.Column="2" Margin="5" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"> <Image x:Name="imageViewer" Cursor="Hand" RenderTransformOrigin="0,0" Margin="0"> <Image.LayoutTransform> <ScaleTransform ScaleX="...

Using XamlReader for controls that does not have a default constructor

I have some string representations of Xaml objects, and I want to build the controls. I'm using the XamlReader.Parse function to do this. For a simple control such as Button that has a default constructor not taking any parameters this works fine: var buttonStr = "<Button xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentatio...

WF4RC, How to: Activity to Xaml?

Hello all, I have Googled a bit, and cannot seem to find any examples of Xaml-fying Activities - good, bad, or otherwise! public static string ToXaml (this Activity activity) { // i would use ActivityXamlServices to go from Xaml // to activity, but how to go other way? documentation // is slim, and cannot infer proper usage...

[XAML] hittesting

Hi, In the model i have a observable collection of objects. With a itemscontrol (and usercontrol) i display these elements (shapes). Now i want to do hittesting on the parrent canvas. For example when I execute this code: HitTestResult result = VisualTreeHelper.HitTest(allContent, new Point(70, 340)); I get a HitTestResult, but i want...

Problem with WPF Effects and Video Card

Hi, I'm building a WPF application and this WPF application is having a toolbar-like panel that I use for adding button based on the context. The code of the toolbar is: <Grid x:Name="ToolBarGrid" VerticalAlignment="Top" Height="46"> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> ...

[XAML] event mediaElement

Hello, Is there a manner to start a video(media element) without a click on a button? So I mean from the code behind with a Binding or something like that? <Grid Background="Black" Width="{Binding Shape.Width}" Height="{Binding Shape.Height}"> <Grid.Triggers> <EventTrigger ...> <EventTrigger.Action...

ColumnDefinition MinWidth doesn't work correctly

Hi, I'm using a Grid in WPF (xaml) and I'm have some strange effect when using the MinWidth property in a ColumnDefinition. For example, when I use 9 ColumnDefinition and every ColumnDefinition has the 'Width="*"' property and one of the middle columns also has a MinWidth property then the size of the other columns is wrong. Well, it's...

WPF toggle buttons with custom template not accepting click in correct area

I'm a relative beginner in the WPF space so I'm sure this will be the first of many questions! I have a series of toggle buttons all with a custom template designed to show an image with a transparent background that then becomes highlighted when the user toggles the button. I wanted to add padding around the content so that the highlig...

Controls appear inactive when changing content

I'm using a ContentControl to display various ViewModels, which all use DataTemplates for view generation. Now the problem is, after i change the content (by clicking on a hyperlink for example), things such as hyperlinks appear inactive (i.e. grayed out), until i click on the UI again. Is there any way to avoid this behaviour without ha...

How to create interface for C++ application with XAML?

How to create interface for C++ application with XAML? (I SEARCH FOR SOME APP LIKE EXPRESSION BLEND (OR even beter a plug in for it)) ...

Need to support data display in both feet and meters

I have a Silverlight application that needs to display data in both English (feet, pounds etc.) and metric (meters, kilograms etc) units. I would like the user to be able to choose which units of measure he wishes displayed, which would vary by user. Trying to be a good programmer allowing for proper encapsulation and separation of conc...

Trick for seeing databound list controls in the VS XAML Editor

Is there any way to see what a control will look like in the XAML designer when it's ItemSource property is databound? I want to see what it looks like in the designer somehow without actually running the application. ...

How to turn XAML to pure C#?

How to turn XAML to pure C# (xaml was made for c# app )? ...

Accessibility for Silverlight Combobox Items

In my Silverlight page I have a combobox. In the code-behind I'm filling the combobox items like so: this.ProblemList.Items.Add(Strings.Review_SelectProblem); this.ProblemList.Items.Add(Strings.Review_IncorrectCharacters); this.ProblemList.Items.Add(Strings.Review_MissingText); ... this.ProblemList.SelectedIndex = 0; //Set the default ...

3d polygon in xaml

Is there any way to draw a 3d polygon in xaml/directx using only point3d? ...

Resizing Border control

I've got controls strewn around a Canvas that the user can manipulate, and I'd like to make it so that the user can resize these controls by dragging a border edge. I could write a custom control, but before I dive into that, I'd like to find out if anyone has solved this problem already. ...

How can I bind an image MouseDown event with a RoutedUICommand

I have a RoutedUICommand that can be bind to multiple controls in xaml. I have a few Button controls and an image which should be bound to this Command. It's very simple to bind a command with buttons like <Button Name="btnAction1" Command="local:MainWindow.Command1"/> But I am unable to find a way to bind a mousedown event of image ...