//colocação dos botões dos numeros no scroll viewer private void setScrollNumbers() { this.WrapScrollPanel.Children.Clear(); // Set Scroll Arrows YouWindow.setScrollArrows(ScrollLeft, ScrollRight, 0.65, 0.1, 0.17, 0, 0.17, 0.9); // Scroll Panel WrapScrollPanel.Height = h * 0.55; Canvas.SetTop(WrapScrollPanel, h * 0.27); Canvas.SetLeft(WrapScrollPanel, 0); // scrollViewer ScrollViewer.HoverBackground = Brushes.Transparent; ScrollViewer.Height = h * 0.65; ScrollViewer.Width = w; ScrollViewer.ScrollToHorizontalOffset(150); Canvas.SetTop(ScrollViewer, h * 0.27); Canvas.SetLeft(ScrollViewer, 0); for (i = 0; i < 14; i++) { // Button var button = new YouButton() { }; //button.Background = new SolidColorBrush(Colors.LightSeaGreen); button.Width = w * 0.15; button.Height = h * 0.20; button.Name = "a" + numeros[i]; // button.Label = numeros[i]; button.Background = null; button.LabelBackground = null; button.Click += new RoutedEventHandler(Button_Click); button.EnterEvent += new onHandEnterHandler(Button_Hover_Event); button.LeaveEvent += new onhandLeaveHandler(Button_Leave_Event); // Image Button BitmapImage bitmap = new BitmapImage(); Image img = new Image(); bitmap.BeginInit(); bitmap.UriSource = new Uri("/You_AirPaint;component/Images/Keyboard/" + numeros[i] + ".png", UriKind.Relative); bitmap.EndInit(); img.Stretch = Stretch.Fill; img.Source = bitmap; button.Content = img; button.Background = new ImageBrush(bitmap); // Add to Scroller this.WrapScrollPanel.Children.Add(button); } }
//colocação dos botões das letras no scroll viewer private void setScrollLetters() { this.WrapScrollPanel.Children.Clear(); // Set Scroll Arrows YouWindow.setScrollArrows(ScrollLeft, ScrollRight, 0.65, 0.1, 0.17, 0, 0.17, 0.9); // Scroll Panel WrapScrollPanel.Height = h * 0.65; Canvas.SetTop(WrapScrollPanel, h * 0.27); Canvas.SetLeft(WrapScrollPanel, 0); // scrollViewer ScrollViewer.HoverBackground = Brushes.Transparent; ScrollViewer.Height = h * 0.65; ScrollViewer.Width = w; ScrollViewer.ScrollToHorizontalOffset(350); Canvas.SetTop(ScrollViewer, h * 0.27); Canvas.SetLeft(ScrollViewer, 0); // Add in display content for (i = 0; i < letras.Length; i++) { // Video Button var button = new YouButton() { }; //button.Background = new SolidColorBrush(Colors.LightSeaGreen); button.Width = w * 0.15; button.Height = h * 0.20; button.Name = "a" + letras[i]; //button.Label = letras[i]; button.LabelBackground = null; button.Background = null; button.Click += new RoutedEventHandler(Button_Click); button.EnterEvent += new onHandEnterHandler(Button_Hover_Event); button.LeaveEvent += new onhandLeaveHandler(Button_Leave_Event); if (i == 23 || i == 25) { var button2 = new Button(); button2.Width = w * 0.15; button2.Height = h * 0.20; button2.Visibility = Visibility.Hidden; this.WrapScrollPanel.Children.Add(button2); } if (i == 1) { button.Margin = new Thickness(w * 0.05, 0, 0, 0); } else if (i == 2) { button.Margin = new Thickness(w * 0.1, 0, 0, 0); } else if ((i != 0 && (i - 1) % 3 == 0) || i == 24) { button.Margin = new Thickness(-w * 0.05, 0, 0, 0); } else if ((i != 0 && i % 3 == 0) || i == 23) { button.Margin = new Thickness(-w * 0.1, 0, 0, 0); } BitmapImage bitmap = new BitmapImage(); Image img = new Image(); bitmap.BeginInit(); bitmap.UriSource = new Uri("/You_AirPaint;component/Images/Keyboard/" + letras[i] + ".png", UriKind.Relative); bitmap.EndInit(); img.Stretch = Stretch.Fill; img.Source = bitmap; button.Content = img; button.Background = new ImageBrush(bitmap); // Add to Scroller this.WrapScrollPanel.Children.Add(button); } }