|
Silverlight 拖動(dòng)復(fù)制控件,就是將控件從一個(gè)容器中向另一個(gè)容器中拖動(dòng)時(shí),不是移動(dòng)控件而把該控件到另一個(gè)容器中。這種情形在程序中經(jīng)常遇到,下面是我做的一個(gè)拖動(dòng)復(fù)制控件的示例,僅供有這種需求的朋友們參考。
新建一個(gè) Silverlight 項(xiàng)目命名為 DragAndCopy ,在新建的項(xiàng)目中添加一個(gè)Silverlight 用戶控件(Silverlight user control)命名為 DragObject。項(xiàng)目結(jié)構(gòu)如下圖所示:
其中 DragObject 就是要拖動(dòng)的用戶控件,DragObject 的 Xaml 代碼如下:
<UserControl x:Class="DragAndCopy.DragObject"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Image x:Name="icon" Width="128" Height="128" Stretch="Fill" />
</UserControl>
NET技術(shù):Silverlight 拖動(dòng)復(fù)制控件,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。