Ejemplo n.º 1
0
 private void matrikelnummer_eingetragen(UIElement sender, LosingFocusEventArgs args)
 {
     if (box_matrikelnummer.Text != "")
     {
         List <Student> studi1         = Datamanger.Studenten;
         string         mnummer        = box_matrikelnummer.Text;
         string         mnummerkorrekt = "";
         foreach (Student s in studi1)
         {
             if (s.Matrikelnummer == mnummer)
             {
                 block_matrikelnummer.Text = "";
                 mnummerkorrekt            = mnummer;
                 box_vorname.Text          = s.Vorname;
                 box_name.Text             = s.Nachname;
                 break;
             }
         }
         if (box_matrikelnummer.Text != mnummerkorrekt)
         {
             box_vorname.Text          = "";
             box_name.Text             = "";
             block_matrikelnummer.Text = "Dieser Nutzer ist nicht im System vorhanden!";
         }
     }
     else
     {
         box_vorname.Text          = "";
         box_name.Text             = "";
         block_matrikelnummer.Text = "";
     }
 }
Ejemplo n.º 2
0
 private void OnFocusableLosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (args.OldFocusedElement == focusable && args.NewFocusedElement is ScrollViewer)
     {
         args.Cancel = true;
     }
 }
Ejemplo n.º 3
0
 private void FocusManager_LosingFocus(object sender, LosingFocusEventArgs e)
 {
     if (preventLosingFocus)
     {
         e.Cancel           = true;
         preventLosingFocus = false;
     }
 }
Ejemplo n.º 4
0
 private void EditingElement_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (args.NewFocusedElement is Popup || args.NewFocusedElement is AppBarButton)
     {
         args.Cancel = true;
         args.TryCancel();
     }
 }
Ejemplo n.º 5
0
 private void EditingElement_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (args.NewFocusedElement is Popup)
     {
         args.Cancel = true;
         args.TryCancel();
         args.TrySetNewFocusedElement(args.OldFocusedElement);
     }
 }
Ejemplo n.º 6
0
        private void FontSize_LosingFocus(UIElement sender, LosingFocusEventArgs args)
        {
            if (!SettingsLoaded)
            {
                return;
            }
            Config.SetInt(Config.FontSize, (int)FontSize.Value);

            base.UpdateUi();
        }
Ejemplo n.º 7
0
 private void EditingNameTextBox_OnLosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (!(sender is TextBox textBox))
     {
         return;
     }
     if (textBox.Text.Length == 0)
     {
         textBox.Text = "Untitled";
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Evento que se dispara antes que el Enfoque cambie hacia otro elemento
 /// </summary>
 private void FocusManager_LosingFocus(object sender, LosingFocusEventArgs e)
 {
     if (preventLosingFocus)
     {
         e.Cancel = true;
         // Igualmente se puede hacer uso de
         // e.TryCancel();
         // Ya que no siempre se puede garantizar que el
         // evento se puede cancelar y se evita una excepción.
         preventLosingFocus = false;
     }
 }
Ejemplo n.º 9
0
        private void GraphingControl_LosingFocus(UIElement sender, LosingFocusEventArgs args)
        {
            var newFocusElement = args.NewFocusedElement as FrameworkElement;

            if (newFocusElement == null || newFocusElement.Name == null)
            {
                // Because clicking on the swap chain panel will try to move focus to a control that can't actually take focus
                // we will get a null destination.  So we are going to try and cancel that request.
                // If the destination is not in our application we will also get a null destination but the cancel will fail so it doesn't hurt to try.
                args.TryCancel();
            }
        }
Ejemplo n.º 10
0
        private async void AmountTextBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
        {
            if (double.TryParse(AmountTextBox.Text, out double amount) && double.TryParse(AmountTextBox.Tag.ToString(), out double count))
            {
                if (amount > count)
                {
                    return;
                }

                if (amount != ElementCollection.SelectedElement.Amount)
                {
                    await ElementAmountChanged(ElementCollection.SelectedElement, amount);
                }
            }
        }
Ejemplo n.º 11
0
    private void BookFixed3ViewerControllerControl_LosingFocus(UIElement sender, LosingFocusEventArgs args)
    {
        var ui = args.NewFocusedElement as FrameworkElement;

        if ((this.DataContext as ViewModels.BookViewModel)?.IsControlPinned == true)
        {
            return;
        }
        if (this.BaseUri == ui?.BaseUri)
        {
            return;
        }
        if (ui is Popup)
        {
            return;
        }
        SetControlPanelVisibility(false);
    }
Ejemplo n.º 12
0
 private void TextBox_OnLosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     if (!(sender is TextBox textBox))
     {
         return;
     }
     if (textBox.Text.Length > 0)
     {
         return;
     }
     if (textBox.Header != null && textBox.Header.Equals("M"))
     {
         textBox.Text = "1";
     }
     else
     {
         textBox.Text = "0.0";
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Ons the disable submit.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The <see cref="Windows.UI.Xaml.Input.LosingFocusEventArgs" /> instance containing the event data.</param>
 private void onDisableSubmit(UIElement sender, LosingFocusEventArgs args)
 {
     this.disableSubmit();
 }
Ejemplo n.º 14
0
        private void raum_eingetragen(UIElement sender, LosingFocusEventArgs args)
        {
            if (box_raum.Text != "")
            {
                if (box_matrikelnummer.Text != "")
                {
                    /* Hier ALLES andere einfügen. Das folgende soll das Ende dieser Funktion bilden! */



                    List <String>      raumi        = new List <string>();
                    List <Ausleihe>    ausli        = Datamanger.Ausleihen;
                    string             mnummer      = box_matrikelnummer.Text;
                    string             raumkorrekt  = "";
                    List <Student>     studi1       = Datamanger.Studenten;
                    List <Transponder> studitransis = new List <Transponder>();
                    foreach (Student s in studi1)
                    {
                        if (s.Matrikelnummer == mnummer)
                        {
                            studitransis = s.Berechtingungsliste;
                            studkorrekt  = s;
                            break;
                        }
                    }

                    int                i = 0;
                    int                istausgeliehen = 0;
                    string             raumnmmer      = box_raum.Text;
                    List <Transponder> alleTrans      = Datamanger.Transponders;
                    List <Transponder> studTrans      = studkorrekt.Berechtingungsliste;
                    List <Ausleihe>    alleAusl       = Datamanger.Ausleihen;
                    foreach (Transponder aT in alleTrans)
                    {
                        i = 0;
                        if (aT.Raumliste.Contains(raumnmmer))
                        {
                            foreach (Transponder sT in studTrans)
                            {
                                if (sT == aT)
                                {
                                    foreach (Ausleihe aA in alleAusl)
                                    {
                                        if (aA.Transponder == sT && aA.abegegeben == false)
                                        {
                                            i = 1;
                                            istausgeliehen = 1;
                                            break;
                                        }
                                    }
                                    if (i == 1)
                                    {
                                        break;
                                    }
                                    block_raum.Text      = "";
                                    box_transponder.Text = sT.Transpondernummer.ToString();
                                    transkorrekt         = sT;
                                    i = 2;
                                    break;
                                }
                            }
                            if (i != 1)
                            {
                                break;
                            }
                        }
                        if (i != 1)
                        {
                            i = 3;
                        }
                    }
                    if (istausgeliehen == 1)
                    {
                        box_transponder.Text = "";
                        block_raum.Text      = "Es gibt keinen freien Transponder für diesen Raum!";
                    }
                    else if (i == 0)
                    {
                        box_transponder.Text = "";
                        block_raum.Text      = "Der Nutzer besitzt keine Berechtigung für diesen Raum!";
                    }
                    else if (i == 3)
                    {
                        box_transponder.Text = "";
                        block_raum.Text      = "Diesen Raum gibt es im System nicht!";
                    }


                    /*
                     * foreach (Transponder t in studitransis)
                     * {
                     *  raumi = t.Raumliste;
                     *  i = 0;
                     *  if (raumi.Contains(box_raum.Text))
                     *  {
                     *      foreach (Ausleihe a in ausli)
                     *      {
                     *          if (a.Transponder == t)
                     *          {
                     *              i = 1;
                     *              break;
                     *          }
                     *      }
                     *      if (i == 1) { break; }
                     *      else
                     *      {
                     *
                     *
                     *          foreach (String r in raumi)
                     *          {
                     *              if (box_raum.Text == r)
                     *              {
                     *                  box_transponder.Text = t.Transpondernummer.ToString();
                     *                  raumkorrekt = box_raum.Text;
                     *                  transkorrekt = t;
                     *                  block_raum.Text = "";
                     *                  break;
                     *              }
                     *          }
                     *          // Wenn Raum gefunden wurde, breche ab
                     *
                     *          if (box_raum.Text == raumkorrekt)
                     *          {
                     *              break;
                     *          }
                     *
                     *      }
                     *
                     *  }
                     * }
                     *
                     *
                     * if (box_raum.Text != raumkorrekt && i == 1)
                     * {
                     *  block_raum.Text = "Es gibt keine freien Transponder für diesen Raum!";
                     *  box_transponder.Text = "";
                     * }
                     * else
                     * {
                     *  box_transponder.Text = "";
                     *  block_raum.Text = "Dieser Nutzer besitzt keine Berechtigung auf diesen Raum!";
                     * }
                     *
                     */
                }
                else
                {
                    box_matrikelnummer.PlaceholderForeground = GetSolidColorBrush("FF960909");
                    box_matrikelnummer.PlaceholderText       = "Bitte geben Sie zuerst eine Matrikelnummer ein";
                    Debug.WriteLine("else wird ausgefuehrt");
                }
            }
            else
            {
                box_transponder.Text = "";
                block_raum.Text      = "";
            }
        }
Ejemplo n.º 15
0
 bool ILosingFocusEventArgsResolver.Cancel(LosingFocusEventArgs e) => e.Cancel;
Ejemplo n.º 16
0
 Guid ILosingFocusEventArgsResolver.CorrelationId(LosingFocusEventArgs e) => e.CorrelationId;
Ejemplo n.º 17
0
 private void TextBoxLosingFocus(object sender, LosingFocusEventArgs e)
 {
     SubmitTextbox((TextBox)sender);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Sets a value that marks the routed event as handled. A <c>true</c> value for <see cref="LosingFocusEventArgs.Handled"/>
 /// prevents most handlers along the event route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <param name="handled">
 /// <c>true</c> to mark the routed event handled. <c>false</c> to leave the routed event unhandled,
 /// which permits the event to potentially route further and be acted on by other handlers.
 /// The default is <c>false</c>.
 /// </param>
 public static void Handled(this LosingFocusEventArgs e, bool handled) => Resolver.Handled(e, handled);
Ejemplo n.º 19
0
 bool ILosingFocusEventArgsResolver.TryCancel(LosingFocusEventArgs e) => e.TryCancel();
Ejemplo n.º 20
0
 /// <summary>
 /// Gets the input mode through which an element obtained focus.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>How the element obtained focus.</returns>
 public static FocusState FocusState(this LosingFocusEventArgs e) => Resolver.FocusState(e);
Ejemplo n.º 21
0
 /// <summary>
 /// Sets the most recent focused object.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <param name="newFocusedElement">The most recent focused object.</param>
 public static void NewFocusedElement(this LosingFocusEventArgs e, DependencyObject newFocusedElement) => Resolver.NewFocusedElement(e, newFocusedElement);
Ejemplo n.º 22
0
 /// <summary>
 /// Gets the most recent focused object.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>The most recent focused object.</returns>
 public static DependencyObject NewFocusedElement(this LosingFocusEventArgs e) => Resolver.NewFocusedElement(e);
Ejemplo n.º 23
0
 /// <summary>
 /// Gets a reference to the object that raised the event.
 /// This is often a template part of a control rather than an element that was declared in your app UI.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>The object that raised the event.</returns>
 public static object OriginalSource(this LosingFocusEventArgs e) => Resolver.OriginalSource(e);
Ejemplo n.º 24
0
 /// <summary>
 ///     Обработчик сохранения настроек в файл
 /// </summary>
 private void Page_LosingFocus(UIElement sender, LosingFocusEventArgs args)
 {
     ConfigManager.WriteConfig();
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Gets the input device type from which input events are received.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>The input device type.</returns>
 public static FocusInputDeviceKind InputDevice(this LosingFocusEventArgs e) => Resolver.InputDevice(e);
Ejemplo n.º 26
0
 void ILosingFocusEventArgsResolver.Cancel(LosingFocusEventArgs e, bool cancel) => e.Cancel = cancel;
Ejemplo n.º 27
0
 /// <summary>
 /// Gets the direction that focus moved from element to element within the app UI.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>The direction of focus movement.</returns>
 public static FocusNavigationDirection Direction(this LosingFocusEventArgs e) => Resolver.Direction(e);
Ejemplo n.º 28
0
 bool ILosingFocusEventArgsResolver.TrySetNewFocusedElement(LosingFocusEventArgs e, DependencyObject element) => e.TrySetNewFocusedElement(element);
Ejemplo n.º 29
0
 /// <summary>
 /// Method which occurs before a ListView loses focus.
 /// Deselects all selected elements of a ListView.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void ListView_LosingFocus(UIElement sender, LosingFocusEventArgs args) => ((ListView)sender).SelectedItem = null;
Ejemplo n.º 30
0
 /// <summary>
 /// Gets a value that marks the routed event as handled. A <c>true</c> value for <see cref="LosingFocusEventArgs.Handled"/>
 /// prevents most handlers along the event route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="LosingFocusEventArgs"/>.</param>
 /// <returns>
 /// <c>true</c> to mark the routed event handled. <c>false</c> to leave the routed event unhandled,
 /// which permits the event to potentially route further and be acted on by other handlers.
 /// The default is <c>false</c>.
 /// </returns>
 public static bool Handled(LosingFocusEventArgs e) => Resolver.Handled(e);