Click here to Skip to main content
15,914,322 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Where to go to learn wpf? Pin
Mycroft Holmes5-Jan-15 13:21
professionalMycroft Holmes5-Jan-15 13:21 
AnswerRe: Where to go to learn wpf? Pin
Richard MacCutchan5-Jan-15 22:43
mveRichard MacCutchan5-Jan-15 22:43 
AnswerRe: Where to go to learn wpf? Pin
Vimalsoft(Pty) Ltd12-Jan-15 20:56
professionalVimalsoft(Pty) Ltd12-Jan-15 20:56 
AnswerRe: Where to go to learn wpf? Pin
Subramanyam Shankar17-Mar-15 1:04
professionalSubramanyam Shankar17-Mar-15 1:04 
QuestionMultithreaded Windows with Data Binding Pin
Dominick Marciano5-Jan-15 8:30
professionalDominick Marciano5-Jan-15 8:30 
AnswerRe: Multithreaded Windows with Data Binding Pin
Afzaal Ahmad Zeeshan9-Jan-15 8:41
professionalAfzaal Ahmad Zeeshan9-Jan-15 8:41 
AnswerRe: Multithreaded Windows with Data Binding Pin
SledgeHammer0111-Jan-15 8:37
SledgeHammer0111-Jan-15 8:37 
QuestionWPF DataGrid with ComBox Bound To Enums - Show Descriptions Pin
Kevin Marois5-Jan-15 7:03
professionalKevin Marois5-Jan-15 7:03 
AnswerRe: WPF DataGrid with ComBox Bound To Enums - Show Descriptions Pin
Pete O'Hanlon5-Jan-15 7:19
mvePete O'Hanlon5-Jan-15 7:19 
QuestionGetting error when i drag&drop in WPF Pin
VisualLive1-Jan-15 17:35
VisualLive1-Jan-15 17:35 
AnswerRe: Getting error when i drag&drop in WPF Pin
Afzaal Ahmad Zeeshan9-Jan-15 8:44
professionalAfzaal Ahmad Zeeshan9-Jan-15 8:44 
AnswerRe: Getting error when i drag&drop in WPF Pin
Vimalsoft(Pty) Ltd11-Jan-15 23:52
professionalVimalsoft(Pty) Ltd11-Jan-15 23:52 
QuestionLoop in Dispatch.Invoke Not Updating UI Pin
Dominick Marciano31-Dec-14 16:15
professionalDominick Marciano31-Dec-14 16:15 
QuestionSelectionChanged Event is not firing on View Load in MVVM Pin
Ashfaque Hussain29-Dec-14 20:15
Ashfaque Hussain29-Dec-14 20:15 
QuestionSilverlight? A future? Pin
Sean McPoland26-Dec-14 23:46
Sean McPoland26-Dec-14 23:46 
AnswerRe: Silverlight? A future? Pin
Richard MacCutchan26-Dec-14 23:57
mveRichard MacCutchan26-Dec-14 23:57 
AnswerRe: Silverlight? A future? Pin
Pete O'Hanlon27-Dec-14 2:03
mvePete O'Hanlon27-Dec-14 2:03 
QuestionWhat are those automation peer in WPF? Pin
Super Lloyd22-Dec-14 0:55
Super Lloyd22-Dec-14 0:55 
AnswerRe: What are those automation peer in WPF? Pin
Pete O'Hanlon22-Dec-14 1:32
mvePete O'Hanlon22-Dec-14 1:32 
AnswerRe: What are those automation peer in WPF? Pin
syed shanu23-Dec-14 17:42
professionalsyed shanu23-Dec-14 17:42 
QuestionRouted Event No Responding Pin
Kevin Marois18-Dec-14 9:20
professionalKevin Marois18-Dec-14 9:20 
[UPDATE]
Figured it out. Was binding to the event instead of the Handler
[UPDATE]


I created a user control with this event:

public partial class AssignedEmployeesControl : _BaseUserControl
{
    public static readonly RoutedEvent AssignmentRemovedEvent =
        EventManager.RegisterRoutedEvent("AssignmentRemoved",
        RoutingStrategy.Bubble, typeof(RoutedEventHandler),
        typeof(AssignedEmployeesControl));

    public event RoutedEventHandler AssignmentRemoved
    {
        add { AddHandler(AssignmentRemovedEvent, value); }
        remove { RemoveHandler(AssignmentRemovedEvent, value); }
    }

    protected void OnAssignmentRemoved()
    {
        RaiseEvent(new RoutedEventArgs(AssignmentRemovedEvent));
    }


I then add my control to a DataGrid in another control

<DataGridTemplateColumn Header="Assigned Employees"
                        Width="*">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>

            <vc:AssignedEmployeesControl EngineRef="{Binding 
                                    ElementName=employeeJobAssignmentsView, Path=EngineRef}"
                                    AssignmentShift="{Binding Shift}">

                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="AssignmentRemovedEvent">
                        <i:InvokeCommandAction 
                           Command="{Binding ElementName=employeeJobAssignmentsView, 
                           Path=AssignmentRemovedCommand}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>

            </vc:AssignedEmployeesControl>

        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>


I then have a command to catch the event:

private ICommand _AssignmentRemovedCommand;
public ICommand AssignmentRemovedCommand
{
    get
    {
        if (_AssignmentRemovedCommand == null)
            _AssignmentRemovedCommand = new RelayCommand(p =>
                assignmentRemovedExecuted(), p => assignmentRemovedCanExecute());
        return _AssignmentRemovedCommand;
    }
}

private bool assignmentRemovedCanExecute()
{
    return true;
}
private void assignmentRemovedExecuted()
{
}


When I run it, my control calls OnAssignmentRemoved, but the host control's assignmentRemovedExecuted method never fires.

I get no compilation errors or ouput methods. I get no response at all.

Can anyone see what's wrong?

Thanks
If it's not broken, fix it until it is


modified 18-Dec-14 16:01pm.

QuestionBest way to stroke a path with TWO colors? Pin
SledgeHammer0117-Dec-14 11:17
SledgeHammer0117-Dec-14 11:17 
SuggestionRe: Best way to stroke a path with TWO colors? Pin
Matt T Heffron17-Dec-14 11:39
professionalMatt T Heffron17-Dec-14 11:39 
GeneralRe: Best way to stroke a path with TWO colors? Pin
SledgeHammer0117-Dec-14 12:06
SledgeHammer0117-Dec-14 12:06 
QuestionWPF DataGrid Date Format Pin
Kevin Marois17-Dec-14 7:21
professionalKevin Marois17-Dec-14 7:21 

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.