Download Demonstration Question? Contact Us
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 MyPanel: FlexPanel
{
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();
}
}
Demo
References:
No comments:
Post a Comment