public static AnimateHeight ( double from, double to, |
||
from | double | |
to | double | |
control | ||
duration | double | |
return | void |
private void Panel_MouseEnter(object sender, MouseEventArgs e) { if (StaticDeclarations.IsFullscreen) { StaticFunctions.AnimateHeight(4, 42, Panel, 0.2); } }
private void Panel_MouseLeave(object sender, MouseEventArgs e) { if (StaticDeclarations.IsFullscreen) { StaticFunctions.AnimateHeight(42, 3, Panel, 0.2); StaticFunctions.AnimateHeight(ListContainer.Height, 0, ListContainer, 0.2); } }
private void RefreshButton_OnPreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e) { SnackBar.Text("Easter egg :)"); SnackBar.Visibility = Visibility.Visible; StaticFunctions.AnimateHeight(0, 42, SnackBar, 0.1); }
private async void textBox_KeyDown(object sender, KeyEventArgs e) { try { if (System.IO.File.Exists(StaticDeclarations.Historypath) && textBox.Text != null) { ShowSuggestions(); if (string.IsNullOrEmpty(textBox.Text.Trim()) == false) { MagicBox.Clear(); foreach (string str in allItems1) { if (str.Contains(textBox.Text.Trim())) { string[] split = str.Split(splitChar); await MagicBox.AddSuggestion(split[1], split[0], mainWindow); } } } else if (textBox.Text.Trim() == "") { MagicBox.Clear(); foreach (string str in allItems1) { string[] split = str.Split(splitChar); await MagicBox.AddSuggestion(split[1], split[0], mainWindow); } } StaticFunctions.AnimateHeight(ListContainer.Height, MagicBox.ItemsCount * MagicBox.ItemHeight, ListContainer, 0.2); } else { ListContainer.Height = 0; HideSuggestions(); } } catch (Exception ex) { Console.WriteLine("Listbox find suggestions error: " + ex.Message + " " + ex.Data); } if (e.Key == Key.Down) { MagicBox.Focus(); } if (e.Key == Key.Enter) { dynamic textArray = textBox.Text.Split(); if ((textBox.Text.Contains(".") && !textBox.Text.Contains(" ") && !textBox.Text.Contains(" .") && !textBox.Text.Contains(". ")) || textArray[0].Contains(":/") || textArray[0].Contains(":\\")) { WebView.Load(textBox.Text); } else { try { dynamic dyn = JsonConvert.DeserializeObject(System.IO.File.ReadAllText("settings.json")); if (Convert.ToString(dyn.SE) == "Google") { textBox.Text = textBox.Text.Replace(textBox.Text, "http://google.com/#q=" + textBox.Text); WebView.Load(textBox.Text); } if (Convert.ToString(dyn.SE) == "DuckDuckGo") { textBox.Text = textBox.Text.Replace(textBox.Text, "https://duckduckgo.com/?q=" + textBox.Text); WebView.Load(textBox.Text); } if (Convert.ToString(dyn.SE) == "Bing") { textBox.Text = textBox.Text.Replace(textBox.Text, "http://www.bing.com/search?q=" + textBox.Text); WebView.Load(textBox.Text); } } catch (Exception ex) { Console.WriteLine("textBox KeyDown Key.Enter error: " + ex.Message + " " + ex.Data); } } HideSuggestions(); } }