Saturday, February 14, 2015

How to create a panel with LinsUIWPF Suite

Download   Demonstration  Question?   Contact Us


1.     Follow the link How to create a new project to create your project with LinsUIWPF Suite.
2.     Project->Add New Item …, it should bring up the following dialog.

Choose “WPF” as Category and “User Control (WPF)” as Template. Use “MyPanel” as the class name. Click “Add” button.
3.     Open MyPanel.xaml. Change the following code,
<UserControl x:Class="MyDemo.MyPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<Grid>
           
</Grid>
</UserControl>
to as follows, and assign a unique ID to it. The unique ID is for layout persistent. It should be between 1,000 and 10,000,000.
<src:FlexPanel x:Class="MyDemo.MyPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:src="clr-namespace:LinsUIWPF;assembly=LinsUIWPF"
Height="300" Width="300" ID="1002">
<Grid>
            
</Grid>
</src:FlexPanel>
4.     Open MyPanel.xaml.cs.
Add the following line,
using LinsUIWPF;
and change the following code,
public partial class MyPanel : UserControl
{
public MyPanel()
{
InitializeComponent();
}
to as follows, 
public partial class MyPanelFlexPanel
{
public MyPanel ()
{
InitializeComponent();
}
}
5.     Open Window1.xaml.cs.
Add the following code,
public partial class Window1 : LinsMDIWindow
{
public Window1()
{
InitializeComponent();

MyPanel panel = new MyPanel();
panel.ShowPanel();
}
}

No comments:

Post a Comment