Exemple #1
0
        private void ButtonOnKnock(object sender, RoutedEventArgs args)
        {
            MedievalButton btn = args.Source as MedievalButton;

            MessageBox.Show("The button labeled \"" + btn.Text +
                            "\" has been knocked.", Title);
        }
Exemple #2
0
        public GetMedieval()
        {
            Title = "Get Medieval Button";

            MedievalButton btn = new MedievalButton();

            btn.Text                = "Click this button";
            btn.FontSize            = 24;
            btn.HorizontalAlignment = HorizontalAlignment.Center;
            btn.VerticalAlignment   = VerticalAlignment.Center;
            btn.Padding             = new Thickness(5, 20, 5, 20);
            btn.Knock              += ButtonOnKnock;
            Content = btn;
        }