

How do I permanently disable Extensions in Chrome?.How do I turn off Chrome notifications?.How do I remove Extensions from Chrome Android?.How do I disable Chrome mobile plugins?.If you only suspend backspace events in javascript in Safari too, this will only have an effect in Mac/Safari, and keep the default functionality for every other browser. You can use to find the browser type, and only attach the RootVisual_KeyUp handler if the browser is Safari. It's worth noting that all of this can be Mac/Safari specific. This is a small price to pay in my opinion though, considering the alternatives are to view the previous page or not handle backspace at all! You will need to release backspace and press it again to delete another character. This means that if you are using Safari and hold backspace down, only one character will be deleted. Because we have to manually listen to KeyUp events, the Key.Back KeyUp event is only fired when the backspace key is released. This should just be equal to the SelectionStart property's value. Finally, you need to work out the correct location of where the cursor should be now. SelectionStart gives you the location you want to delete from, and SelectionLength gives you how many characters you want to delete. We do this by looking at the TextBox's SelectionStart and SelectionLength properties.

KeyEventArgs' original source is a TextField and the key itself was Key.Back, then we must delete some text inside of the textbox manually.

This will mean that Silverlight never takes you to the previous page any more, but you also won't be able to delete any text in a text field! Point 2 explains how to work around this.Īttach a KeyUp event handler to the RootVisual of your Silverlight control.

Don't allow any backspace events to reach the Silverlight container. Suspend all of the backspace key down events using Javascript. I spent a good week or so trying to come up with a solution, and eventually the best way to work around this problem (I never found a "fix" so to speak) was the following:
