Click here to Skip to main content
15,888,271 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Moving Data from Silverlight to ASp.net via SQl server Pin
Mark Salsbery9-Jun-11 19:10
Mark Salsbery9-Jun-11 19:10 
GeneralRe: Moving Data from Silverlight to ASp.net via SQl server Pin
Vimalsoft(Pty) Ltd9-Jun-11 19:14
professionalVimalsoft(Pty) Ltd9-Jun-11 19:14 
GeneralRe: Moving Data from Silverlight to ASp.net via SQl server Pin
Mark Salsbery10-Jun-11 6:10
Mark Salsbery10-Jun-11 6:10 
AnswerRe: Moving Data from Silverlight to ASp.net via SQl server Pin
Mycroft Holmes9-Jun-11 14:15
professionalMycroft Holmes9-Jun-11 14:15 
GeneralRe: Moving Data from Silverlight to ASp.net via SQl server Pin
Vimalsoft(Pty) Ltd9-Jun-11 19:11
professionalVimalsoft(Pty) Ltd9-Jun-11 19:11 
QuestionWPF Code Creation of input Binding Pin
Ed Hill _5_9-Jun-11 0:32
Ed Hill _5_9-Jun-11 0:32 
AnswerRe: WPF Code Creation of input Binding Pin
SledgeHammer019-Jun-11 6:49
SledgeHammer019-Jun-11 6:49 
GeneralRe: WPF Code Creation of input Binding Pin
Ed Hill _5_9-Jun-11 22:17
Ed Hill _5_9-Jun-11 22:17 
The following appears to impelemtn what you suggested, to be honest i'm not sure that i understand the need/benifit to use an attached behaviour insted of inheriting from a control.
public static class LookupBehaviour
{
    public static Boolean? GetEscapeToClear(ComboBox comboBox)
    {
        return (Boolean?) comboBox.GetValue(EscapeToClearProperty);
    }
    public static void SetEscapeToClear(ComboBox comboBox, Boolean? value)
    {
        comboBox.SetValue(EscapeToClearProperty, value);
    }

    public static readonly DependencyProperty EscapeToClearProperty = DependencyProperty.Register("EascapeToClear",
                                                                                                  typeof (Boolean?),
                                                                                                  typeof (LookupBehaviour),
                                                                                                  new UIPropertyMetadata(null, OnEscapeToCearChanged));

    private static void OnEscapeToCearChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        if (!(d is ComboBox)) return;
        var cmb = d as ComboBox;
        if ((e.NewValue is Boolean?) && (e.NewValue as Boolean?).HasValue)
        {
            var escapeBindingCommand = new KeyBinding(ApplicationCommands.NotACommand, new KeyGesture(Key.Escape));
            var escapeBidning = new Binding("EscapeCommand");
            BindingOperations.SetBinding(escapeBindingCommand, InputBinding.CommandProperty, escapeBidning);
            cmb.InputBindings.Add(escapeBindingCommand);
        }
    }
}


One thing that i didn't like was when creating the key binding that you have to specify a tempory command, ApplicationCommands.NotACommand, and then bind over the top of it, if there is any way to avoid that please let me know. Thanks for the origional reply.
GeneralRe: WPF Code Creation of input Binding Pin
SledgeHammer0110-Jun-11 5:05
SledgeHammer0110-Jun-11 5:05 
Questiontextbox value Pin
arkiboys8-Jun-11 1:36
arkiboys8-Jun-11 1:36 
AnswerRe: textbox value Pin
Pete O'Hanlon8-Jun-11 1:45
mvePete O'Hanlon8-Jun-11 1:45 
GeneralRe: textbox value Pin
arkiboys8-Jun-11 2:04
arkiboys8-Jun-11 2:04 
GeneralRe: textbox value Pin
Pete O'Hanlon8-Jun-11 2:09
mvePete O'Hanlon8-Jun-11 2:09 
GeneralRe: textbox value Pin
arkiboys8-Jun-11 2:26
arkiboys8-Jun-11 2:26 
GeneralRe: textbox value Pin
Sparkling_ouc8-Jun-11 22:16
Sparkling_ouc8-Jun-11 22:16 
GeneralRe: textbox value Pin
Pete O'Hanlon8-Jun-11 2:25
mvePete O'Hanlon8-Jun-11 2:25 
GeneralRe: textbox value Pin
Ed Hill _5_9-Jun-11 0:44
Ed Hill _5_9-Jun-11 0:44 
GeneralRe: textbox value Pin
Pete O'Hanlon9-Jun-11 0:48
mvePete O'Hanlon9-Jun-11 0:48 
GeneralRe: textbox value Pin
Ed Hill _5_9-Jun-11 0:50
Ed Hill _5_9-Jun-11 0:50 
GeneralRe: textbox value Pin
Pete O'Hanlon9-Jun-11 1:04
mvePete O'Hanlon9-Jun-11 1:04 
GeneralRe: textbox value Pin
Ed Hill _5_9-Jun-11 5:59
Ed Hill _5_9-Jun-11 5:59 
Questionany suggestions on how to deploy this MVVM model in Silverlight 4? Pin
Michael J. Eber6-Jun-11 12:11
Michael J. Eber6-Jun-11 12:11 
AnswerRe: any suggestions on how to deploy this MVVM model in Silverlight 4? Pin
Abhinav S6-Jun-11 22:29
Abhinav S6-Jun-11 22:29 
GeneralRe: any suggestions on how to deploy this MVVM model in Silverlight 4? Pin
Michael J. Eber7-Jun-11 7:47
Michael J. Eber7-Jun-11 7:47 
GeneralRe: any suggestions on how to deploy this MVVM model in Silverlight 4? Pin
Paul Daniel Ruston8-Jun-11 12:25
Paul Daniel Ruston8-Jun-11 12:25 

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.