예제 #1
0
        private void Button3_Click(object sender, RoutedEventArgs e)
        {
            FullWindowPopup popup = new FullWindowPopup();
            var             child = (Grid)XamlReader.Load(
                @"<Grid
    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
    xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
    xmlns:mc=""http://schemas.openxmlformats.org/markup-compatibility/2006""
        Background=""Blue"" VerticalAlignment=""Top"">
        <StackPanel>
            <TextBlock Text=""Title"" FontSize=""18""/>
            <TextBlock Text=""Body"" FontSize=""15""/>
        </StackPanel>
    </Grid>"
                );

            popup.Child   = child;
            popup.Opened += Popup_Opened;
            popup.Closed += Popup_Closed;
            child.Tapped += async(s, args) =>
            {
                popup.Hide();
                txtMsg.Text = "点击了模拟 Toast。";
                await Task.Delay(3000);

                txtMsg.Text = string.Empty;
            };
            popup.Show();

            HideFullWindowPopupOnNavigating(popup);
        }
예제 #2
0
        public void InitToTop()
        {
            popup = new FullWindowPopup();

            var canvas = new Canvas();

            popup.Child = canvas;

            var border = new Border();

            border.BorderThickness  = new Thickness(1);
            border.BorderBrush      = new SolidColorBrush(Colors.Gray);
            border.CornerRadius     = new CornerRadius(5);
            border.Padding          = new Thickness(5);
            border.Background       = new SolidColorBrush(Colors.DeepSkyBlue);
            border.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
            border.Child            = new TextBlock()
            {
                Text = "Top", FontSize = 20
            };
            border.PointerPressed  += border_PointerPressed;
            border.PointerReleased += border_PointerReleased;
            border.PointerMoved    += border_PointerMoved;

            canvas.Children.Add(border);

            Canvas.SetLeft(border, 100);
            Canvas.SetTop(border, 400);

            popup.Show();
        }
예제 #3
0
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            FullWindowPopup popup = new FullWindowPopup();

            popup.Background = new SolidColorBrush(Colors.Red);
            popup.Show();

            HideFullWindowPopupOnNavigating(popup);
        }