Click here to Skip to main content
15,900,816 members
Home / Discussions / WPF
   

WPF

 
QuestionApply two animations to a text block simultanously Pin
WBurgMo29-Jun-10 16:00
WBurgMo29-Jun-10 16:00 
AnswerRe: Apply two animations to a text block simultanously Pin
Insincere Dave1-Jul-10 9:10
Insincere Dave1-Jul-10 9:10 
GeneralRe: Apply two animations to a text block simultanously Pin
WBurgMo1-Jul-10 10:35
WBurgMo1-Jul-10 10:35 
QuestionDetecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh29-Jun-10 4:19
kartheesh29-Jun-10 4:19 
AnswerRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Abhinav S29-Jun-10 20:30
Abhinav S29-Jun-10 20:30 
AnswerRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon29-Jun-10 22:15
mvePete O'Hanlon29-Jun-10 22:15 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh29-Jun-10 22:58
kartheesh29-Jun-10 22:58 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon30-Jun-10 7:05
mvePete O'Hanlon30-Jun-10 7:05 
To give you an idea what a Behavior looks like, he's one I put together for selecting all text when a textbox gets focus. You will want to consider creating a variation on this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Interactivity;

namespace Goldlight.Extensions.Behaviors
{
    public class SelectAllTextBehavior : Behavior<TextBox>
    {
        /// <summary>
        /// Hook up to the Keyboard focus and Mouse capture events.
        /// </summary>
        protected override void OnAttached()
        {
            base.OnAttached();
            AssociatedObject.GotKeyboardFocus += new System.Windows.Input.KeyboardFocusChangedEventHandler(AssociatedObject_GotKeyboardFocus);
            AssociatedObject.GotMouseCapture += new System.Windows.Input.MouseEventHandler(AssociatedObject_GotMouseCapture);
        }

        /// <summary>
        /// Dereference the Keyboard focus and Mouse capture events.
        /// </summary>
        protected override void OnDetaching()
        {
            base.OnDetaching();
            AssociatedObject.GotKeyboardFocus -= new System.Windows.Input.KeyboardFocusChangedEventHandler(AssociatedObject_GotKeyboardFocus);
            AssociatedObject.GotMouseCapture -= new System.Windows.Input.MouseEventHandler(AssociatedObject_GotMouseCapture);
        }

        /// <summary>
        /// Handle the mouse capture event.
        /// </summary>
        void AssociatedObject_GotMouseCapture(object sender, System.Windows.Input.MouseEventArgs e)
        {
            AssociatedObject.SelectAll();
        }

        /// <summary>
        /// Handle the keyboard focus event.
        /// </summary>
        void AssociatedObject_GotKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
        {
            AssociatedObject.SelectAll();
        }
    }
}

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
kartheesh1-Jul-10 18:56
kartheesh1-Jul-10 18:56 
GeneralRe: Detecting the CellText,Selected length, Cursor position on edit mode in WPF datagrid. Pin
Pete O'Hanlon1-Jul-10 11:59
mvePete O'Hanlon1-Jul-10 11:59 
QuestionHow do you generate classes from XAML in Visual Studio 2008? Pin
Xarzu28-Jun-10 12:31
Xarzu28-Jun-10 12:31 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
Abhinav S28-Jun-10 18:41
Abhinav S28-Jun-10 18:41 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
#realJSOP29-Jun-10 2:26
professional#realJSOP29-Jun-10 2:26 
AnswerRe: How do you generate classes from XAML in Visual Studio 2008? Pin
Pete O'Hanlon29-Jun-10 2:51
mvePete O'Hanlon29-Jun-10 2:51 
Questionwhy wcf use basicHttpBinding instead of wsHttpBinding Pin
ctlqt1228-Jun-10 9:44
ctlqt1228-Jun-10 9:44 
AnswerRe: why wcf use basicHttpBinding instead of wsHttpBinding Pin
Abhinav S28-Jun-10 18:35
Abhinav S28-Jun-10 18:35 
QuestionVS2008 Doesn't Allow Debugging of Silverlight apps [SOLVED] Pin
#realJSOP27-Jun-10 2:13
professional#realJSOP27-Jun-10 2:13 
AnswerRe: VS2008 Doesn't Allow Debugging of Silverlight apps Pin
Abhinav S27-Jun-10 7:12
Abhinav S27-Jun-10 7:12 
QuestionBegginer - Binding object in XAML Pin
ekimpl26-Jun-10 0:40
ekimpl26-Jun-10 0:40 
AnswerRe: Begginer - Binding object in XAML Pin
Pete O'Hanlon26-Jun-10 2:35
mvePete O'Hanlon26-Jun-10 2:35 
GeneralRe: Begginer - Binding object in XAML [modified] Pin
ekimpl26-Jun-10 3:28
ekimpl26-Jun-10 3:28 
AnswerRe: Begginer - Binding object in XAML Pin
Abhinav S26-Jun-10 5:53
Abhinav S26-Jun-10 5:53 
GeneralRe: Begginer - Binding object in XAML Pin
ekimpl26-Jun-10 6:08
ekimpl26-Jun-10 6:08 
GeneralRe: Begginer - Binding object in XAML Pin
Abhinav S26-Jun-10 6:20
Abhinav S26-Jun-10 6:20 
GeneralRe: Begginer - Binding object in XAML Pin
ekimpl26-Jun-10 6:30
ekimpl26-Jun-10 6:30 

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.