Skip to content

Commit

Permalink
Just some thoughts feel free to revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Keboo committed Mar 19, 2023
1 parent a1a013b commit 4424bb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
18 changes: 12 additions & 6 deletions MainDemo.Wpf/HintIssues.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@
<StackPanel Grid.Column="0" Grid.Row="3" Margin="0,30,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding ElementName=ApplyFixedWidth, Path=IsChecked, Converter={StaticResource FixedWidthConverter}}">
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource ShortHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource ShortHelper}}"
Margin="0,0,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}" />
Margin="0,0,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}"
HorizontalAlignment="Left"/>
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource MediumHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource MediumHelper}}"
Margin="0,15,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}" />
Margin="0,15,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}"
HorizontalAlignment="Left"/>
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource LongHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource LongHelper}}"
Margin="0,15,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}" />
Margin="0,15,0,0" Style="{StaticResource MaterialDesignFloatingHintTextBox}"
HorizontalAlignment="Left"/>
</StackPanel>
<!-- MaterialDesignFilledTextBox style -->
<StackPanel Grid.Column="0" Grid.Row="4" Margin="0,30,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding ElementName=ApplyFixedWidth, Path=IsChecked, Converter={StaticResource FixedWidthConverter}}">
Expand All @@ -97,13 +100,16 @@
<StackPanel Grid.Column="0" Grid.Row="5" Margin="0,30,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding ElementName=ApplyFixedWidth, Path=IsChecked, Converter={StaticResource FixedWidthConverter}}">
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource ShortHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource ShortHelper}}"
Margin="0,0,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}" />
Margin="0,0,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}"
HorizontalContentAlignment="Left"/>
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource MediumHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource MediumHelper}}"
Margin="0,20,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}" />
Margin="0,20,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}"
HorizontalContentAlignment="Left"/>
<TextBox md:HintAssist.Hint="{Binding ElementName=ApplyHintText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource LongHint}}"
md:HintAssist.HelperText="{Binding ElementName=ApplyHelperText, Path=IsChecked, Converter={StaticResource BoolToParameterConverter}, ConverterParameter={StaticResource LongHelper}}"
Margin="0,20,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}" />
Margin="0,20,0,0" Style="{StaticResource MaterialDesignOutlinedTextBox}"
HorizontalContentAlignment="Left"/>
</StackPanel>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<VisualTransition From="*" To="HintFloatingPosition">
<Storyboard>
<DoubleAnimation EasingFunction="{StaticResource AnimationEasingFunction}"
Storyboard.TargetName="FloatingHintTextBlock"
Storyboard.TargetName="FloatingHintContent"
Storyboard.TargetProperty="Opacity"
To="{TemplateBinding HintOpacity}"
Duration="0:0:0.15" />
Expand All @@ -105,7 +105,7 @@
<VisualTransition From="*" To="HintRestingPosition">
<Storyboard>
<DoubleAnimation EasingFunction="{StaticResource AnimationEasingFunction}"
Storyboard.TargetName="FloatingHintTextBlock"
Storyboard.TargetName="FloatingHintContent"
Storyboard.TargetProperty="Opacity"
Duration="0:0:0.15" />
<DoubleAnimation EasingFunction="{StaticResource AnimationEasingFunction}"
Expand All @@ -117,7 +117,7 @@
</VisualStateGroup.Transitions>
<VisualState x:Name="HintFloatingPosition">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="FloatingHintTextBlock"
<DoubleAnimation Storyboard.TargetName="FloatingHintContent"
Storyboard.TargetProperty="Opacity"
To="{TemplateBinding HintOpacity}"
Duration="0" />
Expand All @@ -129,7 +129,7 @@
</VisualState>
<VisualState x:Name="HintRestingPosition">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="FloatingHintTextBlock"
<DoubleAnimation Storyboard.TargetName="FloatingHintContent"
Storyboard.TargetProperty="Opacity"
Duration="0" />
<DoubleAnimation Storyboard.TargetName="ScaleHost"
Expand All @@ -140,16 +140,16 @@
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<wpf:ScaleHost x:Name="ScaleHost" />
<Canvas ClipToBounds="True" HorizontalAlignment="Stretch" Height="{Binding ElementName=FloatingHintTextBlock, Path=ActualHeight}">
<Canvas.RenderTransform>
<Grid ClipToBounds="True" HorizontalAlignment="Stretch" Height="{Binding ElementName=FloatingHintContent, Path=ActualHeight}">
<Grid.RenderTransform>
<MultiBinding Converter="{StaticResource FloatingHintCanvasTransformConverter}">
<Binding ElementName="ScaleHost" Path="Scale" />
<Binding Path="FloatingScale" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Source="{StaticResource NoContentFloatingScale}" />
<Binding Path="FloatingOffset" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</Canvas.RenderTransform>
<ContentControl x:Name="FloatingHintTextBlock"
</Grid.RenderTransform>
<ContentControl x:Name="FloatingHintContent"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Hint}"
Expand Down Expand Up @@ -183,7 +183,7 @@
</MultiBinding>
</ContentControl.RenderTransform>
</ContentControl>
</Canvas>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down

0 comments on commit 4424bb3

Please sign in to comment.