Click here to Skip to main content

Silverlight / WPF

AnswerRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer012-Feb-13 11:28 
GeneralRe: Opening new WPF form in seperate thread. PinmemberHema Bairavan3-Feb-13 3:57 
GeneralRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer013-Feb-13 8:41 
GeneralRe: Opening new WPF form in seperate thread. PinmemberJason Gleim1-Mar-13 9:00 
QuestionHow to user control view open in center of main parent window ? Pinmemberrahul ameta2-Feb-13 2:56 
Questionarrange elements inside wpf PinmemberRemix Mixdox1-Feb-13 23:27 
AnswerRe: arrange elements inside wpf PinmvpAbhinav S3-Feb-13 8:02 
QuestionCustom Controls PinmemberSawyer19881-Feb-13 8:05 
Hi! Began studying wpf. Versed with custom control'ami. I create the control (simple button) from Control.
The question is - is it possible to not draw method OnRend (such as they call it), and make the template, the file generic.xaml? And still do not understand why does not my click handler.Confused | :confused:
файл MyButton.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
namespace My_Lib
    public class MyButton : Control
        public static readonly RoutedEvent MyClickEvent;  
        static MyButton()
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MyButton), new FrameworkPropertyMetadata(typeof(MyButton)));
            MyClickEvent = EventManager.RegisterRoutedEvent("MyClick", RoutingStrategy.Bubble,
                typeof(RoutedEventHandler), typeof(MyButton));                       
        public event RoutedEventHandler MyClick
            add {
                base.AddHandler(MyButton.MyClickEvent, value);
            remove {
                base.RemoveHandler(MyButton.MyClickEvent, value);

файл generic.xaml

файл MainWindow.xaml.cs
namespace MyComponentsTest
    public partial class MainWindow : Window
        public MainWindow()
        private void myButton1_MyClick(object sender, RoutedEventArgs e)

QuestionApplication Launcher PinmemberMycroft Holmes31-Jan-13 14:49 
AnswerRe: Application Launcher PinmvpAbhinav S1-Feb-13 9:22 
QuestionWPF controls refresh Pinmembercaradri31-Jan-13 2:50 
AnswerRe: WPF controls refresh PinprotectorPete O'Hanlon31-Jan-13 3:44 
GeneralRe: WPF controls refresh Pinmembercaradri31-Jan-13 11:20 
GeneralRe: WPF controls refresh PinmemberRichard Deeming31-Jan-13 12:25 
GeneralRe: WPF controls refresh [modified] Pinmembercaradri2-Feb-13 18:59 
GeneralRe: WPF controls refresh Pinmembercaradri3-Feb-13 21:16 
QuestionRoutedEvent vs AttachedEvent Pinmemberdevvvy29-Jan-13 23:30 
AnswerRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon29-Jan-13 23:51 
GeneralRe: RoutedEvent vs AttachedEvent [modified] Pinmemberdevvvy30-Jan-13 0:02 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 1:45 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 3:40 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 3:44 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 4:08 
QuestionWPF Tab Item Close Button [modified] PinmemberKevin Marois29-Jan-13 19:03 
AnswerRe: WPF Tab Item Close Button PinmemberSledgeHammer0129-Jan-13 20:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 15 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid