Hello Petar,
Thanks for response and demo project.
but it is restricting to only numeric control to paste value with CommandTarget property.
It should be flexible to paste value in multiple controls as well as any type of controls (Textbox, listbox, combobox, Radmaskednumeric).
Also i have created custom control (wrapper on Radmaskednumericinput control to specify default properties).
Please refer below code and inform how Applicationcommand.paste can be worked with all below controls.
MainWindow.xaml
----------------------------
<Window x:Class="WpfApplication5.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow"
Width="525"
xmlns:local="clr-namespace:WpfApplication5"
Height="350">
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.Paste"
Executed="CommandBinding_Executed_1" />
</Window.CommandBindings>
<StackPanel >
<telerik:RadToolBar >
<telerik:RadButton Command="ApplicationCommands.Copy" Content="Copy" x:Name="copyButton"/>
<telerik:RadButton Command="ApplicationCommands.Paste" Content="Paste" x:Name="pasteButton"/>
</telerik:RadToolBar>
<TextBox Text="123" />
<TextBox Text="456"/>
<TextBox Text="789" />
<TextBlock Height="20" Text="123456789"></TextBlock>
<Label Content="1234"/>
<local:FormattedNumericInput Width="50" />
<local:FormattedNumericInput Width="50" />
</StackPanel>
</Window>
FormatNumericControl.cs
-----------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace WpfApplication5
{
public class FormattedNumericInput : Telerik.Windows.Controls.RadMaskedNumericInput
{
#region Constructors
public FormattedNumericInput()
{
AllowNegativeNumbers = false;
IsClearButtonVisible = false;
SelectionOnFocus = Telerik.Windows.Controls.SelectionOnFocus.DefaultSelectAll;
Mask = "";
FormatString = "0";
SpinMode = Telerik.Windows.Controls.MaskedInput.SpinMode.None;
}
#endregion
}
}