Friday, October 23, 2009

Can Infection Increase Your Blood Pressure

Inheriting a WPF UserControl

To inherit a UserControl in WPF is very simple;

Just follow these steps; first step in creating the class to be associated with 'UserControl:
public class CollectionUCPage : System.Windows.Controls. UserControl
{
public CollectionUCPage () : base () {}

public string VariabilePerTutti { get ; September ;}}

This creates the ' we want to inherit from the UserControl class CollectionUCPage;

file. xaml should be amended as follows:

< src : CollectionUCPage

xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns : x ="http://schemas.microsoft.com/winfx/2006/xaml"
mc : Ignorable ="d"
xmlns : src ="clr-namespace:WpfControlLibrary"
x
: Name = "userme "
...

As you can see it is introduced REFERENCE or xmlns: src = "clr-namespace: WpfControlLibrary" that indicates where to find the compiled control.

now modify the file cs:

public partial class UCMia : CollectionUCPage
{
......................... ................
.........................................

The game is done!

0 comments:

Post a Comment