Click here to Skip to main content
14,423,168 members

Silverlight / WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 4:09
cofounderChris Maunder16-Jul-09 4:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 4:05
cofounderChris Maunder16-Jul-09 4:05 
QuestionIm new bie help me fix 1 erorr on wpf, i cant do it? Pin
Member 1468037212-Jan-20 17:07
MemberMember 1468037212-Jan-20 17:07 
GeneralRe: Im new bie help me fix 1 erorr on wpf, i cant do it? Pin
Richard MacCutchan12-Jan-20 23:12
communityengineerRichard MacCutchan12-Jan-20 23:12 
AnswerRe: Im new bie help me fix 1 erorr on wpf, i cant do it? Pin
ZurdoDev13-Jan-20 2:07
mveZurdoDev13-Jan-20 2:07 
QuestionRoutedEvent Pass EventArg Pin
Kevin Marois11-Jan-20 17:42
professionalKevin Marois11-Jan-20 17:42 
I have added a Routed Event to a user control:
public static readonly RoutedEvent ItemChangedEvent =
            EventManager.RegisterRoutedEvent("ItemChanged",
            RoutingStrategy.Bubble,
            typeof(RoutedEventHandler),
            typeof(DropDownEntryView));

public event RoutedEventHandler ItemChanged
{
    add { AddHandler(ItemChangedEvent, value); }
    remove { RemoveHandler(ItemChangedEvent, value); }
}

private void RaiseItemChangedEvent(string newValue, string oldValue)
{
    var args = new ItemChangedEventArgs(ItemChangedEvent, newValue, oldValue);
    RaiseEvent(args);
}
Here is the ItemChangedEventArgs class:
public class ItemChangedEventArgs : RoutedEventArgs
{
    public string NewValue { get; private set; }

    public string OldValue { get; private set; }

    public ItemChangedEventArgs(RoutedEvent routedEvent, string newValue, string oldValue)
        : base(routedEvent)
    {
        NewValue = newValue;
        OldValue = OldValue;
    }
}
The XAML
<ctrls:DropDownEntryView Grid.Column="0" 
                            Items="{Binding DataContext.EmailItems, 
                                            ElementName=clientsView,  
                                            Mode=TwoWay, 
                                            UpdateSourceTrigger=PropertyChanged}" 
                            EditBarCaption="Edit Emails..."
                            ShowEditBar="True"
                            ItemCategoryKey="email_types"
                            HorizontalAlignment="Left"
                            Width="400"
                            Margin="5">

<pre>
<i:Interaction.Triggers>
    <i:EventTrigger EventName="ItemChanged">
        <i:InvokeCommandAction Command="{Binding ElementName=clientsView, Path=DataContext.EmailItemChangedCommand}" 
                                CommandParameter="{Binding}"/>
    </i:EventTrigger>
</i:Interaction.Triggers>



How do I pass the ItemChangedEventArgs in the XAML?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: RoutedEvent Pass EventArg Pin
Gerry Schmitz11-Jan-20 21:24
mveGerry Schmitz11-Jan-20 21:24 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois12-Jan-20 11:05
professionalKevin Marois12-Jan-20 11:05 
GeneralRe: RoutedEvent Pass EventArg Pin
Gerry Schmitz13-Jan-20 14:23
mveGerry Schmitz13-Jan-20 14:23 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 6:18
professionalKevin Marois14-Jan-20 6:18 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 6:43
professionalKevin Marois14-Jan-20 6:43 
AnswerRe: RoutedEvent Pass EventArg Pin
Richard Deeming13-Jan-20 9:00
communityengineerRichard Deeming13-Jan-20 9:00 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 10:02
professionalKevin Marois14-Jan-20 10:02 
QuestionCalculate the textbox value based on the value of combobox ? ( wpf ) Pin
Member 146803727-Jan-20 20:44
MemberMember 146803727-Jan-20 20:44 
QuestionRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Richard MacCutchan7-Jan-20 22:17
communityengineerRichard MacCutchan7-Jan-20 22:17 
AnswerRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Member 146803727-Jan-20 22:49
MemberMember 146803727-Jan-20 22:49 
SuggestionRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Richard Deeming8-Jan-20 1:46
communityengineerRichard Deeming8-Jan-20 1:46 
QuestionRefresh Attached Property? Pin
Kevin Marois7-Jan-20 11:17
professionalKevin Marois7-Jan-20 11:17 
AnswerRe: Refresh Attached Property? Pin
Richard Deeming8-Jan-20 2:18
communityengineerRichard Deeming8-Jan-20 2:18 
QuestionWPF Exception - Send Error Report Pin
Kevin Marois30-Dec-19 8:41
professionalKevin Marois30-Dec-19 8:41 
AnswerRe: WPF Exception - Send Error Report Pin
Richard MacCutchan30-Dec-19 11:13
communityengineerRichard MacCutchan30-Dec-19 11:13 
AnswerRe: WPF Exception - Send Error Report Pin
jimmson2-Jan-20 4:15
Memberjimmson2-Jan-20 4:15 
AnswerRe: WPF Exception - Send Error Report Pin
Gerry Schmitz2-Jan-20 21:09
mveGerry Schmitz2-Jan-20 21:09 
AnswerRe: WPF Exception - Send Error Report Pin
Mycroft Holmes3-Jan-20 11:49
MemberMycroft Holmes3-Jan-20 11:49 
QuestionMenuButton CanExecute Firing Wrong Pin
Kevin Marois24-Dec-19 12:42
professionalKevin Marois24-Dec-19 12:42 

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.