I am reading a database file and based on the no. of entries output from the database to my query, I want to populate the buttons. And on clicking any of these buttons, I wa
Rather than creating a ControlTemplate,just create a Style.Then the code would be like :
ControlTemplate
Style
Button btn = new Button btn.Style= (Style)FindResource("RoundBtn") grid.Children.Add(btn); btn.click += new EventHandler(btn_click); private void btn_Click(object sender, RoutedEventArgs e) { }