xaml

Custom Expression for TextDecoration in Expression Blend

How to set a Custom Expression for TextDecorations for a TextBlock in Expression Blend2? For Eg: a Custom expression for StrikeThrough ...

Binding to a value within a Resource?

Assuming one has this Resource: <Window.Resources> <ImageBrush x:Key="MyImageBrush" Opacity="0.5" ImageSource="image1.png" Stretch="None" AlignmentX="Center" AlignmentY="Center" /> </Window.Resources> Then how would I get to the Opacity value of that resource? I've tried the following but it doesn't work. ...

Stretch ComboBox Content in Silverlight

This is driving me nuts. I can't seem to get the data template within my ComboBox to stretch the width of the pulldown. What gives? <Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ComboBox x:Name="Searches...

Microsoft.VisualStudio.Xaml is not loading (vs2008), it errors, how to re-register?

Hi there, recently got an issue when loading vs 2008, it displays this... can anyone tell me how to reregister the file... or something.. I don't wish to reinstall the vs 2008 again.... The Microsoft.VisualStudio.Xaml ({E58C2A8B-BCC4-4559-AD59-D62EB6D58A22}) did not load because of previous errors. For assistance, contact the package ...

Convert XHTML to XAML?

Good afternoon, does anyone know of a good xhtml to xaml converter library / functionality? All the ones I've found are far from complete, are missing elements of the base xhtml namespace (e.g. tables etc) and what I need is to display valid xhtml in an wpf flowdocument. Any ideas / suggestions? Cheers & thanks -Jörg ...

Grid vs. Canvas

I'm looking for opinion on using Canvas vs. Grid panels in WPF. I need to make classic input forms that have basically grid layouts, some may have small datagrids inside, groupboxes, but all aligned in grid layout. I’m struggling whether to use Grid or Canvas panel for all my forms. Grid is giving me good structure; I can maintain alignm...

Calling a parametrized constructor from XAML

While using WPF i noticed that when i add a control to a xaml file, the default constructor is called. Is there a way to call a parametrized constructor. ...

Read-only Run elements in a WPF RichTextBox?

I may be completely imagining this, but I could have sworn there was a way to make individual Run (or Parapgraph) elements in a RichTextBox read-only. I also could have sworn I tried a method for doing this out myself a few weeks ago and was satisfied with the results - I vaguely remember it looked something like this: <RichTextBox x:Na...

Creating Xaml control in (aspx)web application.

Is it possible to create a .xaml (silverlight) control in a web application project? I have an aspx application wherein I am using ajax controls and updatepanel. I want to create some silverlight controls in the same project, and load it along with my other pages/controls. I am not sure if it is possible to create a silverlight control...

Transform XAML syntax from Shorthand to full syntax

Is there a tool or a simple way to transform XAML code from the shorthand syntax to the full syntax? For example: moving from something like: <_TextBox Text="{Binding Path=Formula.Production, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> to <_TextBox> <_TextBox.Text> <Binding Path="Formula.NumCloses" Mode="TwoWay" Up...

Difference between TargetType="controlType" and TargetType="{x:Type controlType}"

In WPF you can set the TargetType to either the name of the type or you can set it to {x:Type nameOfType}. Does anyone know what the difference is? ...

Resize ElementHost to size of the hosted Xmal UserControl

Hi, I would like an expanding panel in my Windows Forms app. I was having a look to see if this would be possible using the WPF Expander control. I've created a Xaml UserControl where I've inherited from Expander rather than UserControl. I have a trigger on the Expander for setting it's size. Is it possible to change the height of the ...

How to make WPF WebBrowser grow horizontally and vertically?

In WPF, we are using a WebBrowser control to view HTML content. When we place the control on our window, it grows horizontally with the window as it grows/shrinks. However, we have not found a way to make the control grow vertically with the window. We are looking for some sample code that will allow the WebBrowser WPF control to grow...

Automatically Remove Hyperlink Buttons from ListBox

Hi, I have worked through the answer provided here. I have been able to create a list of automatically generated Hyperlink buttons in a ListBox. The goal is that, when a different user is typed into the box and the button is clicked, they old artists are removed (assuming it's a valid username) and replaced with the artists from the n...

Styling WPF slider background

I'm trying to apply a specific style to a slider control and I'm having trouble figuring out what I need to do for the slider's background. What do I need to do to get something like this triangle to show in the background of my slider? I initially thought I would define a GeometryDrawing and set something in the tickbar tag to it - bu...

Can WinForms and XAML not benefit from the same logic as CSS?

Can WinForms and XAML not benefit from the same logic as CSS? It occured to me this morning, as i was browsing some of my unanswered questions on Stackoverflow: If you're not using FlowLayoutPanel or a TableLayoutPanel, to layout controls on your WinForm, you'll be accused of not doing it right. This is in contrast with the (religi...

Avoiding Visual Studio designer errors when WPF resource is defined in separate project

How can I avoid Visual Studio designer errors when a WPF resource is defined in separate project? I have three projects in a composite WPF application: the main application, an "infrastructure" library, and a "module" library. The main application references the other projects via their output DLLs (the projects are not located in a sin...

Adding a custom dependency property to a Control Template in XAML

Hi all, I have managed to get further with my read only check box after a bit of a break and now have the functionality I want in a reasonably elegant form. The problem is I have used a bit of a hack to make it work, although this is not a disaster it would be nice to do it better. To recap: I want a regular looking checkbox that does ...

Setting the namespace in XAML

Suppose I have a top-level ResourceDictionary element in a XAML file with no C# code-behind. How can I put this element in a specific namespace? ...

Can I create a cross browser compatible silverlight page without code behind?

I have been developing a silverlight page using just xaml, javascript and html (I literally only have a .html, .js and .xaml file). The problem is, I just realized that it isn't working in any browser EXCEPT Internet Explorer (7 for sure). I have too many lines of code to want to add vb.net or visual c code behind and use the html brid...