Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Copy paste a control

Copy paste a control

Scheduled Pinned Locked Moved WPF
wpfcsharpcssdotnetcom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vinod sankuthodi
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups