示例#1
0
        private void Pushpin_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Pushpin pushpin  = sender as Pushpin;
            Job     jobModel = null;

            if (pushpin != null)
            {
                jobModel = pushpin.DataContext as Job;
            }

            CapptainAgent.Instance.SendSessionEvent("Pushpin_Tapped", new Dictionary <object, object> {
                { "jobModelId", jobModel.Id }
            });

            if (jobModel == null)
            {
                return;
            }

            //Create an instance of the field engineer info controls to be shown within popup
            var userControl = new FieldEngineerInfoControl(jobModel);

            //Create a instance of the Flyout
            var tooltipPopup = new Windows.UI.Xaml.Controls.Flyout();

            tooltipPopup.Content = userControl;

            //Show the tooltip
            tooltipPopup.ShowAt(pushpin);
        }
        private static async void Setup(Windows.UI.Xaml.Controls.Flyout m)
        {
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                return;
            }
            var s = GetItemsSource(m);

            if (s == null)
            {
                return;
            }
            var t = GetItemTemplate(m);

            if (t == null)
            {
                return;
            }
            var c = new Windows.UI.Xaml.Controls.ItemsControl
            {
                ItemsSource  = s,
                ItemTemplate = t,
            };
            var n = Windows.UI.Core.CoreDispatcherPriority.Normal;

            Windows.UI.Core.DispatchedHandler h = () => m.Content = c;
            await m.Dispatcher.RunAsync(n, h);
        }
        private void WindowButton_Click(object sender, RoutedEventArgs e)
        {
            Windows.UI.Xaml.Controls.Flyout flyout = new Windows.UI.Xaml.Controls.Flyout();
            flyout.Content =
                new Border()
            {
                Width      = 300,
                Height     = 300,
                Background = new SolidColorBrush(Windows.UI.Colors.Red),
            };

            flyout.ShowAt(global::Windows.UI.Xaml.Window.Current.Content as FrameworkElement);
        }
        private void ButtonButton_Click(object sender, RoutedEventArgs e)
        {
            Windows.UI.Xaml.Controls.Flyout flyout = new Windows.UI.Xaml.Controls.Flyout();
            flyout.Content =
                new Border()
            {
                Width      = 300,
                Height     = 300,
                Background = new SolidColorBrush(Windows.UI.Colors.Red),
            };

            flyout.ShowAt((Button)sender);
        }
示例#5
0
        public Flyout_Target()
        {
            this.InitializeComponent();

            _flyout = new Windows.UI.Xaml.Controls.Flyout()
            {
                Content = new Border
                {
                    Height     = 100,
                    Width      = 100,
                    Background = new SolidColorBrush(Colors.Red)
                }
            };
        }
示例#6
0
        private void OnClickFull(object s, RoutedEventArgs e)
        {
            result.Text = "";
            var target = s as FrameworkElement;

            var flyout = new Windows.UI.Xaml.Controls.Flyout()
            {
                Content = new Border
                {
                    Name       = "innerContent",
                    Height     = 100,
                    Width      = 100,
                    Background = new SolidColorBrush(Colors.Red)
                },
                Placement = Windows.UI.Xaml.Controls.Primitives.FlyoutPlacementMode.Full
            };

            flyout.ShowAt(target);
        }
示例#7
0
        private void OnClick(object s, RoutedEventArgs e)
        {
            result.Text = "";

            var flyout = new Windows.UI.Xaml.Controls.Flyout()
            {
                Content = new Border
                {
                    Name       = "innerContent",
                    Height     = 100,
                    Width      = 100,
                    Background = new SolidColorBrush(Colors.Red)
                }
            };

            var target = s as FrameworkElement;

            flyout.ShowAt(target);

            var success = flyout.Target == target;

            result.Text = success ? "success" : "failed";
        }
示例#8
0
        public Button()
        {
            InitializeVisualStates();

            Click += (s, e) => { Flyout?.ShowAt(this); };
        }