xaml

How to go from bad to good OOP design?

I'm reading a lot about good and bad practices in OOP design. It's nice to know your design is bad, or good. But how do you get from bad to good design? I've split the interface (xaml) and codebehind from the main businesslogic class. That last class is growing big. I've tried splitting it up into smaller classes, but I'm stuck now. Any...

Microsoft Blend June 2.5 expired

Hi. I can't find newer Microsoft Blend Preview. Is it available? Thank you for your answers. ...

How do I bind resource strings in XAML to multiple attributes within the same control ?

Is it possible to bind an additional resource string to another attribute within a control. I already have one attribute bound to a resource but also need another. I can't see a way of doing it as I would need an extra DataContext but oviously can only have one. The additional attribute I need to bind to is Content within the hyperlink ...

How to get the hex data for setting a Path object's Data property in XAML

I have an image and i want to set its hex data as the data for the Path object in a button in XAML. Is there a tool that will get me the Hex data for this purpose? ...

Where can I find some sample WPF animations?

As I am a programmer,and not an artist or animator and I am failing at showing off the best features of WPF in my application. Although I have samples for simple animations for buttons like growing, or having the color fade into something brighter on click but what I am looking for is some showcase button animations and some showcase pa...

WPF BitmapSource ImageSource

I am binding an Image.Source property to the result of the property shown below. public BitmapSource MyImageSource { get { BitmapSource source = null; PngBitmapDecoder decoder; using (var stream = new FileStream(@"C:\Temp\logo.png", FileMode.Open, FileAccess.Read, FileShare.Read)) { decoder = new PngBitmapDecod...

WPF EventRouting to Children

Is there any way to broadcast a RoutedEvent to all of my children in WPF? For example lets say I have a Window that has 4 children. 2 of them know about the RoutedEvent 'DisplayYourself' and are listening for it. How can I raise this event from the window and have it sent to all children? I looked at RoutingStrategy and Bubble is the ...

WPF RadioButton groups in Xaml

In the WPF app we are building, we have 3 groups of RadioButtons in individual StackPanels side by side. We are trying to program the following behavior. When tabbing through the form, we don't want to tab through each of the radiobuttons (standard behavior), instead we would like to tab to the "first" radiobutton in each group and have ...

Using FixedPage markup on a Content Model control

Hello! In WPF, I have tried passing the markup of an XPS file's FixedPage to a control that has the Content property (ex. Button.Content = XamlReader.Load()). Example of FixedPage markup: <FixedPage Width="816" Height="1056" xmlns="http://schemas.microsoft.com/xps/2005/06" xml:lang="und"> <Path Data="M 115.52,132.48 L 704.64,132....

What is the best way to slide a panel in WPF?

I have a fairly simple UserControl that I have made (pardon my Xaml I am just learning WPF) and I want to slide the off the screen. To do so I am animating a translate transform (I also tried making the Panel the child of a canvas and animating the X position with the same results), but the panel moves very jerkily, even on a fairly fas...

Refreshing a wpf databinding after object has been updated

I have a object in a presenter connected to a view. Inside my XAMTL I have the following: <Label Content="{Binding ElementName=PSV, Path=Presenter.Portfolio.Name}"/> Now when the control is created, Portfolio is null, then i run another method which sets Portfolio. I've implemented INotifyPropertyChanged but so far, I've not been able...

How to copy line in XAML editor?

In Visual Studio.NET when coding I constantly use (no selection) CTRL-C, CTRL-V to make a quick copy of a line. Unfortunately this works differently in the XAML editor (it pastes the new line in the middle of the current line). Does anyone know the hotkey to copy a line in XAML? ...

How do I save a Silverlight 2.0 canvas to a database and export it to PDF

I have a Silverlight 2.0 project that allows a user to add text and images to a canvas. They can move, rotate and resize the text/images. I was wondering the best way to serialize the Silverlight objects to a database and also be able to generate a PDF of the canvas to be printed. I've read some articles about calling a web-service ...

Import XAML into WPF RichTextBox

I have a WPF RichTextBox that is dynamically built in a WPF web service. This web service accepts a xaml string that is extracted from the contents of a third-party silverlight RichTextBox control. <Paragraph TextAlignment=\"Left\"><Run FontFamily=\"Comic Sans MS\" FontSize=\"16\" Foreground=\"#FF0000FF\" FontWeight=\"Bold\" >This text...

How do I provide two default templates for a Custom Control in WPF?

In Charles Petzold's "Using Templates to Customize WPF Controls" article in the Jan 2007 edition of MSDN Magazine (http://msdn.microsoft.com/en-us/magazine/cc163497.aspx), he says, The ProgressBar control actually has two default templates for the two orientations. (This is true of ScrollBar and Slider, as well.) If you want your new...

How to stretch in width a WPF user control to its window?

I have a Window with my user control and I would like to make usercontrol width equals window width. How to do that? The user control is a horizontal menu and contains a grid with three columns: <ColumnDefinition Name="LeftSideMenu" Width="433"/> <ColumnDefinition Name="Middle" Width="*"/> <ColumnDefinition Name="RightSideMenu" Width="...

Embed resources (png,jpg,mp3,wmv,etc) in silverlight xap file and reference from xaml

Basically I would like to be able to do something like this in my xaml: <Image Source="Resources/logout.png" /> and have it find Resources/logout.png as a file in my xap file, without going back to the web server. I also want to be able to rebuild my xap file on the fly, so placing it as a resource in a dll is not acceptable. Any id...

Exporting a GUI to xml?

Is there a tool to take a GUI designed in C# or other languages that can take the screen layout and export that to an XML file such that you end up with a template of the screen in xml terms? As well as take an xml file and display the resulting screen? ...

Library for using SVG in Windows Forms / WPF?

Are there any libraries which Allow to draw svg direct to a Windows Forms application to a WPF application I draw graphics and design everything with Inkscape, because I love that program. Then I have those stunning svgs and have to either export them to png (WinForm) to use them or convert them to xaml-code (WPF) (Kaxaml helps me). ...

XAML: How to mix text and element-databind variables in Content attribute?

When data binding two elements together, how can I include the binding information AND text as in the case below where I want my label to say: The font size is 8.5 <Grid> <StackPanel> <Slider Name="theSlider" Margin="5" Minimum="8" Maximum="14"></Slider> <Label Content="The font size is: {Binding ElementName=theSlid...