ToastControl.xaml 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. <UserControl
  2. x:Class="PDF_Master.CustomControl.ToastControl"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Name="Toast"
  9. Width="auto"
  10. Height="auto"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. Background="Transparent"
  14. IsVisibleChanged="Toast_IsVisibleChanged"
  15. Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Visibility}"
  16. mc:Ignorable="d">
  17. <Border
  18. Name="tipBorder"
  19. HorizontalAlignment="Center"
  20. Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Background}"
  21. CornerRadius="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=CornerRadius}">
  22. <TextBlock
  23. Name="txtTip"
  24. Padding="6,2,6,2"
  25. HorizontalAlignment="Center"
  26. Background="Transparent"
  27. FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=FontSize}"
  28. Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Foreground}"
  29. Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=StringContent}" />
  30. </Border>
  31. </UserControl>