Click here to Skip to main content
       

Silverlight / WPF

 
QuestionData Flow in a WPF App PinmemberAeroClassics9-Feb-13 11:19 
AnswerRe: Data Flow in a WPF App PinmemberSuper Lloyd14-Feb-13 18:08 
QuestionBinding DataGrid PinmemberSawyer19889-Feb-13 3:33 
AnswerRe: Binding DataGrid PinmemberAndy41128-Feb-13 2:25 
QuestionMain Widow Appears on top of the Navigated Window In WPF Navigation Service PinmemberVuyiswa Maseko6-Feb-13 0:43 
QuestionOpening new WPF form in seperate thread. PinmemberHema Bairavan2-Feb-13 8:31 
AnswerRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer012-Feb-13 10:28 
GeneralRe: Opening new WPF form in seperate thread. PinmemberHema Bairavan3-Feb-13 2:57 
GeneralRe: Opening new WPF form in seperate thread. PinmemberSledgeHammer013-Feb-13 7:41 
GeneralRe: Opening new WPF form in seperate thread. PinmemberJason Gleim1-Mar-13 8:00 
QuestionHow to user control view open in center of main parent window ? Pinmemberrahul ameta2-Feb-13 1:56 
Questionarrange elements inside wpf PinmemberRemix Mixdox1-Feb-13 22:27 
AnswerRe: arrange elements inside wpf PinmvpAbhinav S3-Feb-13 7:02 
QuestionCustom Controls PinmemberSawyer19881-Feb-13 7: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
 
 xmlns:local="clr-namespace:My_Lib">
 
файл MainWindow.xaml.cs
 
namespace MyComponentsTest
{
 
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void myButton1_MyClick(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("sd");
        }         
    }
}  

QuestionApplication Launcher PinmemberMycroft Holmes31-Jan-13 13:49 
AnswerRe: Application Launcher PinmvpAbhinav S1-Feb-13 8:22 
QuestionWPF controls refresh Pinmembercaradri31-Jan-13 1:50 
AnswerRe: WPF controls refresh PinprotectorPete O'Hanlon31-Jan-13 2:44 
GeneralRe: WPF controls refresh Pinmembercaradri31-Jan-13 10:20 
GeneralRe: WPF controls refresh PinmemberRichard Deeming31-Jan-13 11:25 
GeneralRe: WPF controls refresh [modified] Pinmembercaradri2-Feb-13 17:59 
GeneralRe: WPF controls refresh Pinmembercaradri3-Feb-13 20:16 
QuestionRoutedEvent vs AttachedEvent Pinmemberdevvvy29-Jan-13 22:30 
AnswerRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon29-Jan-13 22:51 
GeneralRe: RoutedEvent vs AttachedEvent [modified] Pinmemberdevvvy29-Jan-13 23:02 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 0:45 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button [modified] PinmemberKevin Marois29-Jan-13 18:03 
AnswerRe: WPF Tab Item Close Button PinmemberSledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button PinmemberKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button PinmemberSledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 9:12 
AnswerRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 11:32 
GeneralRe: Custom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 12:10 
GeneralRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 12:46 
GeneralTreeview Selection Pinmembervijilvs11628-Jan-13 23:03 
QuestionProblem With TreeViewItem Tooltip [modified] PinmemberKevin Marois26-Jan-13 15:39 
GeneralRe: Problem With TreeViewItem Tooltip PinmemberThomas Duwe29-Jan-13 1:46 
QuestionHow to get a value from treeview. Pinmemberboryborawski26-Jan-13 12:06 
QuestionConstant header and footer Pinmembercolumbos1492725-Jan-13 23:11 
AnswerRe: Constant header and footer PinmvpRichard MacCutchan26-Jan-13 0:05 
QuestionWPF.MDI Pinmembercolumbos1492725-Jan-13 8:37 
AnswerRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 9:29 
GeneralRe: WPF.MDI Pinmembercolumbos1492725-Jan-13 22:11 
GeneralRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 22:33 
AnswerRe: WPF.MDI Pinmembertram730-Nov-13 5:54 
QuestionSilverlight Dispatcher.BeginInvoke not allow thread to run more then one time [modified] PinmemberSteve Holdorf24-Jan-13 12:13 
AnswerRe: Silverlight Dispatcher.BeginInvoke not allow thread to run more then one time Pinmemberdb7uk26-Jan-13 13:11 

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
Web03 | 2.8.140721.1 | Last Updated 25 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid