Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Windows.Controls;
- namespace TestControls.Controls
- {
- public class МyTextBox : TextBox
- {
- public МyTextBox()
- {
- Text = "MyTextBox";
- }
- }
- }
- <UserControl x:Class="TestControls.Controls.MyText"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="400">
- <Grid x:Name="LayoutRoot" Background="White">
- <TextBlock Name="Text"/>
- </Grid>
- </UserControl>
- using System.Windows.Controls;
- namespace TestControls.Controls
- {
- public partial class MyText : UserControl
- {
- public MyText()
- {
- InitializeComponent();
- Text.Text = "MyTextControl";
- }
- }
- }
- <UserControl x:Class="TestControlsApplication.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="400">
- <Grid x:Name="LayoutRoot" Background="White">
- <StackPanel Name="Panel"/>
- </Grid>
- </UserControl>
- using System.Windows.Controls;
- using TestControls.Controls;
- namespace TestControlsApplication
- {
- public partial class MainPage : UserControl
- {
- public MainPage()
- {
- InitializeComponent();
- for (int i = 0; i < 1000; i++)
- {
- MyText t = new MyText();
- МyTextBox tb = new МyTextBox();
- Panel.Children.Add(t);
- Panel.Children.Add(tb);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement