ToastControl.xaml 1.7 KB

1234567891011121314151617181920212223242526272829303132
  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. Padding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Padding}"
  20. HorizontalAlignment="Center"
  21. Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Background}"
  22. CornerRadius="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=CornerRadius}">
  23. <TextBlock
  24. Name="txtTip"
  25. Padding="6,2,6,2"
  26. HorizontalAlignment="Center"
  27. Background="Transparent"
  28. FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=FontSize}"
  29. Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Foreground}"
  30. Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=StringContent}" />
  31. </Border>
  32. </UserControl>