Click here to Skip to main content
15,911,039 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: open a window application when window service starts Pin
Eddy Vluggen5-Aug-12 23:26
professionalEddy Vluggen5-Aug-12 23:26 
GeneralRe: open a window application when window service starts Pin
Dave Kreskowiak6-Aug-12 1:54
mveDave Kreskowiak6-Aug-12 1:54 
AnswerRe: open a window application when window service starts Pin
Bernhard Hiller5-Aug-12 22:37
Bernhard Hiller5-Aug-12 22:37 
AnswerRe: open a window application when window service starts Pin
Pete O'Hanlon6-Aug-12 2:14
mvePete O'Hanlon6-Aug-12 2:14 
QuestionWorking with WPF Pin
Member 82251801-Aug-12 9:37
Member 82251801-Aug-12 9:37 
AnswerRe: Working with WPF Pin
Ed Hill _5_1-Aug-12 22:12
Ed Hill _5_1-Aug-12 22:12 
GeneralRe: Working with WPF Pin
Member 82251802-Aug-12 11:00
Member 82251802-Aug-12 11:00 
GeneralRe: Working with WPF Pin
Ed Hill _5_2-Aug-12 22:49
Ed Hill _5_2-Aug-12 22:49 
If it is just one dataGrid used one time then generally speaking inheritance is not the best way to approach this. Although it is not the only way by any means to work with WPF, the MVVM design is very popular. If you have a set of requirements of what you are looking for your grid to do I will take a look and see if i can provide you with some sample code to get you started. One of the general principles of MVVM is seperating any code that involves your Data from the User Interface, using MVVM i find that it is quite rare that i am using EventHandlers for UI components.

If you are just looking to seperate out your event handlers you could do something like this:
C#
public class MyWindow:Window
{
    private MyDataCollection _gridData;

    public MyWindow()
    {
        InitializeComponent();
        _gridData = new MyDataCollection();
        DataGrid1.RowAdded += _gridData.DataRowAdded;
    }
}


C#
public class MyDataCollection
{
    public void DataRowAdded(object sender, EventArgs e)
    {
    }
}

I'm not saying the above code would be the right solution but you would not be inheriting a control you proabably don't need to if you are just aiming to seperate your Event Handling Code from your Window Code.
GeneralRe: Working with WPF Pin
Member 82251806-Aug-12 9:06
Member 82251806-Aug-12 9:06 
GeneralRe: Working with WPF Pin
Ed Hill _5_6-Aug-12 23:25
Ed Hill _5_6-Aug-12 23:25 
GeneralRe: Working with WPF Pin
Member 82251808-Aug-12 4:28
Member 82251808-Aug-12 4:28 
GeneralRe: Working with WPF Pin
Member 822518015-Aug-12 10:59
Member 822518015-Aug-12 10:59 
GeneralRe: Working with WPF Pin
Ed Hill _5_15-Aug-12 22:10
Ed Hill _5_15-Aug-12 22:10 
GeneralRe: Working with WPF Pin
Ed Hill _5_16-Aug-12 0:08
Ed Hill _5_16-Aug-12 0:08 
GeneralRe: Working with WPF Pin
Member 822518016-Aug-12 2:09
Member 822518016-Aug-12 2:09 
QuestionDynamic properties from Com Interop Pin
Bob Jiang30-Jul-12 5:04
Bob Jiang30-Jul-12 5:04 
AnswerRe: Dynamic properties from Com Interop Pin
Abhinav S30-Jul-12 6:19
Abhinav S30-Jul-12 6:19 
AnswerRe: Dynamic properties from Com Interop Pin
Pete O'Hanlon31-Jul-12 5:08
mvePete O'Hanlon31-Jul-12 5:08 
GeneralRe: Dynamic properties from Com Interop Pin
Bob Jiang31-Jul-12 5:29
Bob Jiang31-Jul-12 5:29 
GeneralRe: Dynamic properties from Com Interop Pin
Pete O'Hanlon31-Jul-12 5:32
mvePete O'Hanlon31-Jul-12 5:32 
QuestionRijndaelManaged Padding is invalid and cannot be removed Pin
Member 906777730-Jul-12 3:28
Member 906777730-Jul-12 3:28 
AnswerRe: RijndaelManaged Padding is invalid and cannot be removed Pin
Dave Kreskowiak31-Jul-12 4:35
mveDave Kreskowiak31-Jul-12 4:35 
GeneralRe: RijndaelManaged Padding is invalid and cannot be removed Pin
Member 90677771-Aug-12 0:02
Member 90677771-Aug-12 0:02 
GeneralRe: RijndaelManaged Padding is invalid and cannot be removed Pin
Pete O'Hanlon1-Aug-12 2:18
mvePete O'Hanlon1-Aug-12 2:18 
GeneralRe: RijndaelManaged Padding is invalid and cannot be removed Pin
Member 90677771-Aug-12 3:53
Member 90677771-Aug-12 3:53 

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

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