Beispiel #1
0
        private void DeleteConfirmation_Click(object sender, RoutedEventArgs e)
        {
            Flyout f = FlyoutService.GetFlyout(Control1) as Flyout;

            if (f != null)
            {
                f.Hide();
            }
        }
Beispiel #2
0
        private void OpenNewUserFlyout()
        {
            var parameters = new FlayoutParamaters
            {
                FlyoutEntityId = 0,
                FlyoutName     = FlyoutNames.UserAuthenticationFlyoutView
            };

            var flyoutService = new FlyoutService(_regionManager, _applicationCommands);

            flyoutService.ShowFlyout(parameters);
        }
Beispiel #3
0
        private void OpenNewWorkspaceFlyout(int?id)
        {
            int newId = 0;

            if (id != null)
            {
                newId = (int)id;
            }

            //TODO: Check if open
            var parameters = new FlayoutParamaters
            {
                FlyoutEntityId = newId,
                FlyoutName     = FlyoutNames.ProjectWorkspaceDetailsFlyoutView
            };

            var flyoutService = new FlyoutService(_regionManager, _applicationCommands);

            flyoutService.SetDataContext(parameters, new ProjectWorkspaceDetailsFlyoutViewModel(_projectRepository)
            {
                EntityId = parameters.FlyoutEntityId
            });
            flyoutService.ShowFlyout(parameters);
        }
Beispiel #4
0
        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            Flyout f = FlyoutService.GetFlyout(LocationIPButton) as Flyout;

            if (f != null)
            {
                f.Hide();
            }

            Mouse.OverrideCursor = Cursors.Wait;
            using (WebClient client = new WebClient())
            {
                client.Headers.Add("user-agent", "request");

                client.DownloadStringCompleted += (senderW, eW) =>
                {
                    var xmlDoc = new XmlDocument();
                    try
                    {
                        xmlDoc.LoadXml(eW.Result);
                        XmlNodeList LatValue  = xmlDoc.GetElementsByTagName("lat");
                        XmlNodeList LongValue = xmlDoc.GetElementsByTagName("lon");

                        double.TryParse(LatValue[0].InnerText, NumberStyles.Any, CultureInfo.InvariantCulture, out double LatValueResult);
                        LatitudeBox.Value = LatValueResult;

                        double.TryParse(LongValue[0].InnerText, NumberStyles.Any, CultureInfo.InvariantCulture, out double LongValueResult);
                        LongitudeBox.Value = LongValueResult;
                    }
                    catch { MessageBox.Show("Error while getting location.", "tinyBrightness", MessageBoxButton.OK, MessageBoxImage.Error); }
                    Mouse.OverrideCursor = null;
                };

                client.DownloadStringAsync(new Uri("http://ip-api.com/xml/"));
            }
        }
Beispiel #5
0
 protected override void OnNavigatedTo()
 {
     base.OnNavigatedTo();
     FlyoutService?.CloseFlyout();
 }