Skip to content

Commit

Permalink
chore: Adjust docs and remove test code
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed Aug 8, 2024
1 parent 4394c77 commit f71d18a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 74 deletions.
2 changes: 1 addition & 1 deletion doc/material-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Previously, the `PlaceholderText` property acted as a header, displaying in the
##### New Behavior

- **PlaceholderText**: Displays inside the TextBox when it's empty. Disappears when text is entered.
- **Header**: Acts as a label. Animates upwards when the TextBox is focused.
- **Header**: Acts as a label. Animates upwards when text is entered.

##### Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,7 @@
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<StackPanel Spacing="10"
HorizontalAlignment="Center"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Orientation="Vertical">
<TextBox Style="{StaticResource MaterialFilledTextBoxStyle}"
x:Name="txtMyTb"
Width="270" />
<TextBox Style="{StaticResource MaterialOutlinedTextBoxStyle}"
x:Name="txtMyTb1"
Width="270" />
<StackPanel HorizontalAlignment="Center"
Orientation="Horizontal">
<Button Content="Add Header"
Click="AddHeader" />
<Button Content="Add Placeholder"
Click="AddPlaceholder" />
<Button Content="Add Text"
Click="AddText" />
</StackPanel>

<StackPanel VerticalAlignment="Center"
Orientation="Horizontal">
<Button Content="Remove Header"
Click="RemoveHeader" />
<Button Content="Remove Placeholder"
Click="RemovePlaceholder" />
<Button Content="Remove Text"
Click="RemoveText" />
</StackPanel>

</StackPanel>
<sample:SamplePageLayout Grid.Row="1">
<sample:SamplePageLayout>
<sample:SamplePageLayout.MaterialTemplate>
<DataTemplate>
<StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,4 @@ public TextBoxSamplePage()
{
this.InitializeComponent();
}

private void AddHeader(object sender, RoutedEventArgs e)
{
txtMyTb.Header = "Header";
txtMyTb1.Header = "Header";
}

private void RemoveHeader(object sender, RoutedEventArgs e)
{
txtMyTb.Header = null;
txtMyTb1.Header = null;
}

private void AddPlaceholder(object sender, RoutedEventArgs e)
{
txtMyTb.PlaceholderText = "Placeholder";
txtMyTb1.PlaceholderText = "Placeholder";
}

private void RemovePlaceholder(object sender, RoutedEventArgs e)
{
txtMyTb.PlaceholderText = null;
txtMyTb1.PlaceholderText = null;
}

private void AddText(object sender, RoutedEventArgs e)
{
txtMyTb.Text = "Text";
txtMyTb1.Text = "Text";
}

private void RemoveText(object sender, RoutedEventArgs e)
{
txtMyTb.Text = null;
txtMyTb1.Text = null;
}
}

0 comments on commit f71d18a

Please sign in to comment.