Hi, I am developing WPF custom control. I need unquie control_Id for each Control in the XAML. when a user drags and drops a control into the XAML window , I can generste the unique identifier in the control constuctor. But when a user copy & paste a control. the CtrlID which is generated in the Constructor is overwritten by previous control's(which is copied) CtrlID in the XAML. e.g. -
<Window x:Class="TestDemo.xml.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="600" Width="800" Resources="TestDemo.xml" xmlns:my="clr-namespace:Philips.PmsMip.Private.Tools.Services.FSF.StudioNew.Controls;assembly=Philips.PmsMip.Private.Tools.Services.FSF.StudioNew.Controls">
<Grid>
<my:FSFComboBox Height="23" HorizontalAlignment="Left" Margin="257,202,0,0" VerticalAlignment="Top" Width="120" ControlID="ComboBox633632137614182049" />
<my:FSFComboBox ControlID="ComboBox633632137614182049" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="120" />
</Grid>
</Window>
Is thr any way I can know in constructor or anywhr in custom control's code that this control is being created by Copy an already existing control.