|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Método Freezable.Clone
Namespace: System.Windows
Assembly: WindowsBase (em WindowsBase.dll)
Mover um Freezable entre segmentos
Button myButton = new Button(); SolidColorBrush myBrush = new SolidColorBrush(Colors.Yellow); // Freezing a Freezable before it provides // performance improvements if you don't // intend on modifying it. if (myBrush.CanFreeze) { // Makes the brush unmodifiable. myBrush.Freeze(); } myButton.Background = myBrush; // If you need to modify a frozen brush, // the Clone method can be used to // create a modifiable copy. SolidColorBrush myBrushClone = myBrush.Clone(); // Changing myBrushClone does not change // the color of myButton, because its // background is still set by myBrush. myBrushClone.Color = Colors.Red; // Replacing myBrush with myBrushClone // makes the button change to red. myButton.Background = myBrushClone;
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Função Server Core sem suporte), Windows Server 2008 R2 (Função Server Core com suporte com o SP1 ou posterior, Itanium sem suporte)
O .NET Framework não oferece suporte a todas as versões de cada plataforma. Para obter uma lista das versões com suporte, consulte .Requisitos de sistema do NET Framework.