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 “MyDocument” as the class name. Click “Add” button.
3. Open MyDocument.xaml. Change the following code,
<UserControl x:Class="MyDemo.MyDocument"
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:FlexDocument x:Class="MyDemo.MyDocument"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:src="clr-namespace:LinsUIWPF;assembly=LinsUIWPF"
Height="300" Width="300" ID="1001">
<Grid>
</Grid>
</src:FlexDocument>
4. Open MyDocument.xaml.cs.
Add the following line,
using LinsUIWPF;
and change the following code,
public partial class MyDocument : UserControl
{
public MyDocument()
{
InitializeComponent();
}
}
to as follows,
public partial class MyDocument : FlexDocument
{
public MyDocument()
{
InitializeComponent();
}
}
5. Open Window1.xaml.cs.
Add the following code,
public partial class Window1 : LinsMDIWindow
{
public Window1()
{
InitializeComponent();
MyDocument doc = new MyDocument();
doc.ShowDocument();
}
}
Demo
References:
No comments:
Post a Comment