command - Julmar WPF helper parameters -


I am using Julmr Helper classes for WPF so I can call on a custom event, an event on MouseEnter Text Box like this:

  & lt; Text box text = "hmm" & gt; & Lt; Julmar: EventCommander.Mappings & gt; & Lt; Julmar: Kmmandavent Command = "{Binding Data Kontentekst. Inkresekyuuuutiik Command, relative Sors = {relative Ssandandstor, Anstrar type = {x: Type Oitskantrol}}}" event = "Mausantr" / & gt; & Lt; / Julmar: EventCommander.Mappings & gt; & Lt; / Text box & gt;  

It works and calls the command, the problem is that I need to pass an object as a parameter, do anyone know that this is possible? The documentation looks quite light.

Earlier I was able to pass the object as a parameter in this way:

   < / Code> 

But obviously I do not need this because it does not fire on mouse events

Any help will be useful,

thanks

You can solve it with behavior-patterns, in fact you have two dependencies with one Make Stm class command and Kmmandprametr you register a handler for both properties.

In a handler, you pass your textbox as a parameter. Now you can hook up with the events you are interested in. If now a registered event handlers have been called, then you can ask the bound command with bound command parameter.

Here is a code sample:

  public class Kmmandhelpr {// // append property // Public Stetmatik Aisimmmand Getcommand (dependency object Obije) {return (Aisimmand) OBG .gate value (command proprietary); } Public Fixed Zero Set Commands (Dependent Object Oz, ICOMMand Value) {obj.SetValue (CommandProperty, Value); } Dependency Property Requirement for Public StablePropty = Dependency Property Registrar ("command", typef (icmand), typef (command hailer), new UIPprotamatadata (empty)); Public Static Object GetCommandParameter (dependency object obj) {return (object) obj.GetValue (CommandParameterProperty); } Public Fixed Zero SetCommandParameter (Dependent Object obj, Object Value) {obj.SetValue (CommandParameterProperty, Value); } Public Static Read-Only Dependency Property CommandApproperty = Dependency Property Registrar ("CommandPamator", Type of (Object), Typef (CommandHailper), New UIPprotamatData (Empty)); // // This property is basically just the same handler will be attached to the control command source // public static Balls GetIsCommandSource (dependency object Obije) which is {return (bool) obj.GetValue (IsCommandSourceProperty); } Public static zero SetIsCommandSource (dependency object obj, bool values) {obj.SetValue (IsCommandSourceProperty, value); } Public static read dependency property ISCommandSourceProperty = DependencyProperty.RegisterAttached for ( "IsCommandSource", typeof (bool), type (CommandHelper), New UIPropertyMetadata (wrong, OnRegisterHandler)); // // Here you can register handler for events, where you can change your command / personal static empty handnage handles (Dependency Object OBJ, Dependency Property) changing event e) {Framework Element Source = Framework Element as OBJE; Source.MouseEnter + = OnMouseEnter; } Private stationary zero onmeter (object sender, mouse eventsErgus E) {dependent object source = sender as disassembly object; Icmcomm command = gatecommand (source); Object command parameter = gatecommment operator (source); // Apply the command if command (command.canuktik (command parameter)) command Exquisition (command parameter); }}  

and Xaml:

  & lt; Text box text = "My command source" local: CommandHelper.IsCommandSource = "true" local: CommandHelper.Command = "{Binding Micromand}" Local: Command Heller. Comma parameter = "mypamator" />  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -