private void CreateButton(object sender, RoutedEventArgs e) { FunctionsImplementations.Size s = new FunctionsImplementations.Size(); s.height = 100; s.width = 100; hook.startMenu.AddButton(null /* iconpath */, null /* exe path */, s, new Thickness(0, 0, 0, 0)); }
public MainWindow() { hook.startMenu.Show(); FunctionsImplementations.Size s = new FunctionsImplementations.Size(); s.height = 100; s.width = 100; Thickness t = new Thickness(); new SettingsMenu().Show(); hook.startMenu.AddButton(null /* iconpath */, null /* exe path */, s, new Thickness(0, 0, 0, 0)); }
public void AddButton(String imageSrc, String path, FunctionsImplementations.Size size, Thickness margin) { Console.WriteLine(defaultMargin); Button b = new Button(); b.Style = Application.Current.Resources["ButtonRevealStyle"] as Style; if (imageSrc != null) { b.Content = new BitmapImage(new Uri(imageSrc)); } else { MessageBox.Show("No button icon, using default", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } b.Width = size.width; b.Height = size.height; b.Margin = FunctionsImplementations.AddMargin(margin, defaultMargin); b.Tag = path; // Throwing path into button properties for shortcut b.AddHandler(Button.ClickEvent, new RoutedEventHandler(b_Click)); grid.Children.Add(b); }