Skip to content

Commit 9f0aac5

Browse files
committed
Added a visible unique ID per control to better visualize creation and persistence of tabs content.
1 parent 08a618e commit 9f0aac5

File tree

8 files changed

+60
-16
lines changed

8 files changed

+60
-16
lines changed

Demo/UserControls/UserControl1.xaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@
1010
<Grid.RowDefinitions>
1111
<RowDefinition Height="Auto" />
1212
<RowDefinition Height="*" />
13+
<RowDefinition Height="Auto" />
1314
</Grid.RowDefinitions>
14-
<!--<StackPanel Margin="30,10">-->
15-
<Label Content="{Binding TabName}"
16-
FontSize="18" />
17-
<ScrollViewer Grid.Row="1">
18-
<TextBlock Text="{Binding MyStringContent}"
19-
TextWrapping="Wrap" />
20-
</ScrollViewer>
21-
<!--</StackPanel>-->
15+
<Label Content="{Binding TabName}"
16+
FontSize="18" />
17+
<ScrollViewer Grid.Row="1">
18+
<TextBlock Text="{Binding MyStringContent}"
19+
TextWrapping="Wrap" />
20+
</ScrollViewer>
21+
22+
<StackPanel Grid.Row="2"
23+
Margin="0,20,0,0"
24+
Orientation="Horizontal">
25+
<TextBlock Text="Unique control ID: " />
26+
<TextBlock x:Name="ID"
27+
FontSize="12" />
28+
</StackPanel>
2229
</Grid>
2330
</UserControl>

Demo/UserControls/UserControl1.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows.Controls;
1+
using System;
2+
using System.Windows.Controls;
23

34
namespace Demo.UserControls
45
{
@@ -10,6 +11,7 @@ public partial class UserControl1 : UserControl
1011
public UserControl1()
1112
{
1213
InitializeComponent();
14+
this.ID.Text = Guid.NewGuid().ToString();
1315
}
1416
}
1517
}

Demo/UserControls/UserControl2.xaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
mc:Ignorable="d"
77
d:DesignHeight="300" d:DesignWidth="300">
8-
<Grid>
8+
<Grid Margin="30,10">
9+
<Grid.RowDefinitions>
10+
<RowDefinition Height="*" />
11+
<RowDefinition Height="Auto" />
12+
</Grid.RowDefinitions>
913
<StackPanel Margin="30,10">
1014
<Label Content="{Binding TabName}"
1115
FontSize="18" />
@@ -15,5 +19,12 @@
1519
SelectedItem="{Binding MySelectedNumber}"
1620
HorizontalAlignment="Left" />
1721
</StackPanel>
22+
<StackPanel Grid.Row="1"
23+
Margin="0,20,0,0"
24+
Orientation="Horizontal">
25+
<TextBlock Text="Unique control ID: " />
26+
<TextBlock x:Name="ID"
27+
FontSize="12" />
28+
</StackPanel>
1829
</Grid>
1930
</UserControl>

Demo/UserControls/UserControl2.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows.Controls;
1+
using System;
2+
using System.Windows.Controls;
23

34
namespace Demo.UserControls
45
{
@@ -10,6 +11,7 @@ public partial class UserControl2 : UserControl
1011
public UserControl2()
1112
{
1213
InitializeComponent();
14+
this.ID.Text = Guid.NewGuid().ToString();
1315
}
1416
}
1517
}

Demo/UserControls/UserControl3.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,25 @@
1111
<RowDefinition Height="Auto" />
1212
<RowDefinition Height="Auto" />
1313
<RowDefinition Height="*" />
14+
<RowDefinition Height="Auto" />
1415
</Grid.RowDefinitions>
1516
<Label Content="{Binding TabName}"
1617
FontSize="18" />
1718
<TextBlock Text="{Binding MyStringContent}"
1819
Grid.Row="1"
1920
Margin="0,0,0,20"
2021
TextWrapping="Wrap" />
22+
2123
<Image Source="{Binding MyImageUrl}"
2224
Grid.Row="2"
2325
Stretch="Uniform" />
26+
27+
<StackPanel Grid.Row="3"
28+
Margin="0,20,0,0"
29+
Orientation="Horizontal">
30+
<TextBlock Text="Unique control ID: " />
31+
<TextBlock x:Name="ID"
32+
FontSize="12" />
33+
</StackPanel>
2434
</Grid>
2535
</UserControl>

Demo/UserControls/UserControl3.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows.Controls;
1+
using System;
2+
using System.Windows.Controls;
23

34
namespace Demo.UserControls
45
{
@@ -10,6 +11,7 @@ public partial class UserControl3 : UserControl
1011
public UserControl3()
1112
{
1213
InitializeComponent();
14+
this.ID.Text = Guid.NewGuid().ToString();
1315
}
1416
}
1517
}

Demo/UserControls/UserControl4.xaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@
99
d:DesignWidth="300">
1010
<Grid Margin="30,10">
1111
<Grid.RowDefinitions>
12-
<RowDefinition Height="Auto" />
1312
<RowDefinition Height="Auto" />
1413
<RowDefinition Height="*" />
14+
<RowDefinition Height="Auto" />
1515
</Grid.RowDefinitions>
16-
<!--<StackPanel Margin="30,10">-->
1716
<Label Content="{Binding TabName}"
1817
FontSize="18" />
18+
1919
<CheckBox Grid.Row="1"
2020
Content="Is blinking"
21-
IsChecked="{Binding IsBlinking,Mode=TwoWay}"/>
21+
IsChecked="{Binding IsBlinking,Mode=TwoWay}" />
22+
23+
<StackPanel Grid.Row="4"
24+
Margin="0,20,0,0"
25+
Orientation="Horizontal">
26+
<TextBlock Text="Unique control ID: " />
27+
<TextBlock x:Name="ID"
28+
FontSize="12" />
29+
</StackPanel>
2230
</Grid>
2331
</UserControl>

Demo/UserControls/UserControl4.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows.Controls;
1+
using System;
2+
using System.Windows.Controls;
23

34
namespace Demo.UserControls
45
{
@@ -10,6 +11,7 @@ public partial class UserControl4 : UserControl
1011
public UserControl4()
1112
{
1213
InitializeComponent();
14+
this.ID.Text = Guid.NewGuid().ToString();
1315
}
1416
}
1517
}

0 commit comments

Comments
 (0)